/** * Display a listing of the resource. * * @return Response */ public function index() { if (Auth::check() && Auth::user()->hasAccessTo('view', 'any', 'book')) { $books = Book::orderBy('title')->get(); return view('genealabs-bones-library::books.index', compact('books')); } }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { if (Auth::user()->hasAccessTo('change', 'any', 'page')) { $page = Page::findOrFail($id); $books = Book::orderBy('title')->get(); return view('genealabs-bones-library::pages.edit', compact('page', 'books')); } // @todo: add access denied flash message return view('genealabs-bones-library::pages.index'); }