public function beheerMateriaal()
 {
     if (Auth::check()) {
         $categories = Categorie::with('materials')->get();
         return View::make('users.admin.beheerMateriaal', ['categories' => $categories]);
     } else {
         return Redirect::to('/');
     }
 }
Example #2
0
 public function getCategoriesWhitMaterials()
 {
     return Categorie::with(array('materials' => function ($q) {
         $q->where('materials.status', '=', 'ok');
     }))->get();
 }