Exemple #1
0
 /**
  * Show the form for edit subscription
  *
  * @return Response
  */
 public function showSubs($id)
 {
     $lunchs = Lunch::with('meal1', 'meal2', 'garnish', 'salad', 'drink', 'additions')->where('user_id', 0)->get();
     $meal1 = Meal1::all();
     $meal2 = Meal2::all();
     $garnishs = Garnish::all();
     $salads = Salad::all();
     $drinks = Drink::all();
     $additions = Addition::all();
     $user = User::findOrFail($id);
     $subs = Sub::with('lunch.meal1', 'lunch.meal2', 'lunch.garnish', 'lunch.salad', 'lunch.drink')->byUser($id)->get();
     $daysOfWeek = trans('vars.day_of_week');
     return view('admin.subs.save', compact('user', 'subs', 'lunchs', 'meal1', 'meal2', 'garnishs', 'salads', 'drinks', 'additions', 'daysOfWeek'));
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     return Lunch::with('meal1', 'meal2', 'garnish', 'salad', 'drink', 'additions')->find($id);
 }