/** * Displays the view for the Admin control panel. * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function index() { if (!$this->authorize('show-admin')) { redirect('home'); } $data = ['page_title' => 'Admin Dashboard', 'users' => User::getUser(), 'num_users' => User::getNumOfUsers(), 'roles' => Role::all(), 'num_admins' => User::getNumAdmins(), 'centers' => Fund::all()]; return view('admin.dashboard', $data); }
/** * Gets a multidimensional array of all of the centers * and the accounts that belong to each. * * @param $center_id * @return array */ public static function getCenter($center_id = false) { $centers = []; if ($center_id) { array_push($centers, Fund::find($center_id)); } else { foreach (Fund::all() as $fund) { array_push($centers, $fund); } } return $centers; }
/** * Used to display the view of an individual center and also pass along * the needed variables and methods. * * @param $center_id * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function getCenterBalance($center_id) { $data = ['center_data' => Fund::getSeparateCenterAccounts($center_id), 'centers' => Fund::all()]; return view('dashboard.center.center-view', $data); }