public static function create() { self::$urls = \Config::get('panel.panelControllers'); $config = \Serverfireteam\Panel\Link::allCached(); $dashboard = array(); $appHelper = new AppHelper(); // Make Dashboard Items foreach ($config as $value) { $modelName = $value['url']; if (in_array($modelName, self::$urls)) { $model = "Serverfireteam\\Panel\\" . $modelName; } else { $model = $appHelper->getNameSpace() . $modelName; } //if (class_exists($value)) { if ($value['show_menu']) { $user = \Auth::guard('panel')->user(); if (!$user->hasRole('super')) { if (!\Auth::guard('panel')->user()->hasPermission($modelName . 'all')) { continue; } } $dashboard[] = array('modelName' => $modelName, 'title' => $value['display'], 'count' => $model::count(), 'showListUrl' => 'panel/' . $modelName . '/all', 'addUrl' => 'panel/' . $modelName . '/edit'); } } return $dashboard; }
public static function create() { self::$urls = \Config::get('panel.panelControllers'); $config = \Serverfireteam\Panel\Link::all(); $dashboard = array(); // Make Dashboard Items foreach ($config as $key => $value) { $modelName = $value['url']; if (in_array($modelName, self::$urls)) { $model = "Serverfireteam\\Panel\\" . $modelName; } else { $appHelper = new AppHelper(); $model = $appHelper->getNameSpace() . $modelName; } //if (class_exists($value)) { $dashboard[] = array('title' => $value['display'], 'count' => $model::all()->count(), 'showListUrl' => 'panel/' . $modelName . '/all', 'addUrl' => 'panel/' . $modelName . '/edit'); } return $dashboard; }