/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $list = \App\ListModel::where('id', $id)->first(); if (Auth::user()->id == $list->user_id) { return view('app.content.list', ['list' => $list]); } return redirect('/list')->withErrors('You do not have permission to access list.'); }
/** * Bootstrap the application services. * * @return void */ public function boot() { view()->composer('app.partials.navLists', function ($view) { return $view->with('userLists', \App\ListModel::where('user_id', \Auth::user()->id)->get()); }); view()->composer('app.partials.nav', function ($view) { return $view->with('user', Auth::user()); }); }