/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $brands = Brand::orderBy('brand')->get(); return view('brand.index', compact('brands')); }
/** * 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'); }
public function index() { $brands = Brand::orderBy('name', 'asc')->get(); return view('backoffice.brands.index', compact('brands')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { return Brand::orderBy('id', 'desc')->get(); }