allCached() public static méthode

public static allCached ( $forceRefresh = false )
Exemple #1
0
 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;
 }
Exemple #2
0
 public static function returnUrls($forceRefresh = false)
 {
     if (!isset(self::$cache['all_urls']) || $forceRefresh) {
         $configs = Link::allCached($forceRefresh);
         self::$cache['all_urls'] = $configs->pluck('url')->toArray();
     }
     return self::$cache['all_urls'];
 }