public function index() { $foods = Food::all(); return response()->json($foods); }
public function all() { if (!Auth::check()) { // The user is logged in... return redirect('auth/login'); } $foods = Food::all(); return response()->json(array('success' => true, 'data' => $foods)); }
/** * Just return list * * @return main page */ public function index() { $foods = Food::all(); return view('food.panel', compact('foods')); }
public function userHome() { $food = \App\Food::all(); return view('user')->with('food', $food); }