Exemplo n.º 1
0
 public function __construct(ContentRepository $content, FlagRepository $flag)
 {
     parent::__construct();
     $this->content = $content;
     $this->flag = $flag;
     if (!user('object')->can('manage_contents')) {
         $this->middleware('deny403');
     }
     if (!Cache::has('flags')) {
         //如果推荐位缓存不存在
         DataCache::cacheFlags();
     }
     $this->flags = Cache::get('flags');
 }