/** * 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'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if (Auth::check() && Auth::user()->hasAccessTo('remove', 'any', 'book')) { Book::destroy($id); return redirect()->route('books.index'); } }