/** * Show the application welcome screen to the user. * * @return Response */ public function index() { $lunchs = Lunch::whereUserId(NULL)->with('meal1', 'meal2', 'garnish', 'salad', 'drink', 'additions')->get(); $meal1 = Meal1::all(); $meal2 = Meal2::all(); $garnishs = Garnish::all(); $salads = Salad::all(); $drinks = Drink::all(); $additions = Addition::all(); $daysOfWeek = trans('vars.day_of_week'); $subs = Auth::user() ? Sub::with('lunch.meal1', 'lunch.meal2', 'lunch.garnish', 'lunch.salad', 'lunch.drink', 'lunch.additions')->byUser(Auth::user()->id)->get() : false; $user = Auth::user() ? User::with('contact')->find(Auth::user()->id) : false; $lunchCount = 3; $menuCount = 5; return view('app', compact('user', 'subs', 'lunchs', 'meal1', 'meal2', 'garnishs', 'salads', 'drinks', 'additions', 'daysOfWeek', 'lunchCount', 'menuCount')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $items = Lunch::whereUserId(NULL)->get(); return view('admin.lunchs.index', compact('items')); }