Commit c3311771 authored by King Alex's avatar King Alex

Fonctions vues CRUD dashboard admin

parent 8493f50b
......@@ -15,6 +15,27 @@ class AdminController extends BaseController {
public function admin()
{
$user=Confide::user();
return View::make('starter')->with('user',$user);
return View::make('templates.admin.starter')->with('user',$user);
}
// TODO : Cascade the ingredients / images so the deletion of one triggers the deletion of the other.
public function recipeList()
{
$recipes = Recipe::all();
$user=Confide::user();
return View::make('templates.admin.recipes')->with(array('recipes'=>$recipes, 'user'=>$user));
}
public function recipeIngredients()
{
$ingredients = Ingredient::all();
$user=Confide::user();
return View::make('templates.admin.ingredients')->with(array('ingredients'=>$ingredients,'user'=>$user));
}
public function recipeImages()
{
$images = Image::all();
$user=Confide::user();
return View::make('templates.admin.images')->with(array('images'=>$images, 'user'=>$user));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment