Exemple #1
0
 public function __construct(Page $page, Content $content, Def $defs)
 {
     $this->page = $page->ofType('default');
     // only load standard pages.
     $this->content = $content;
     $this->definition = array();
     foreach ($defs->all() as $def) {
         $this->definition[$def->id] = $def->definition;
     }
     $this->middleware('admin', ['except' => ['index', 'show']]);
 }
Exemple #2
0
 public function scopeofType($query, $defId)
 {
     return Def::whereid($defId)->first()->definition;
 }