Пример #1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $brands = Brand::orderBy('brand')->get();
     return view('brand.index', compact('brands'));
 }
Пример #2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit(Request $request, $id)
 {
     $food = Food::where('id', $id)->first();
     $brands = Brand::orderBy('name', 'asc')->get();
     if ($food && ($request->user()->id == $food->user_id || $request->user()->is_admin())) {
         return view('foods.edit')->with('food', $food)->withBrands($brands);
     }
     return redirect('/food/index')->withErrors('you have not sufficient permissions');
 }
Пример #3
0
 public function index()
 {
     $brands = Brand::orderBy('name', 'asc')->get();
     return view('backoffice.brands.index', compact('brands'));
 }
Пример #4
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Brand::orderBy('id', 'desc')->get();
 }