Example #1
0
 public static function allCached($forceRefresh = false)
 {
     if (!isset(self::$cache['all']) || $forceRefresh) {
         self::$cache['all'] = Link::all();
     }
     return self::$cache['all'];
 }
Example #2
0
 public static function returnUrls()
 {
     $configs = Link::all();
     $allUrls = array();
     foreach ($configs as $config) {
         $allUrls[] = $config['url'];
     }
     return $allUrls;
 }
Example #3
0
 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;
 }