public function search() { $str = Input::get('str'); $categories = Category::all(); $books = Book::like('title', $str)->get(); return view('store.search', compact('categories', 'books')); }
public function edit($id) { $book = Book::find($id); $categories = Category::lists('name', 'id'); return view('admin.books.edit', compact('book', 'categories')); }
public function destroy($id) { Category::find($id)->delete(); return redirect()->route('admin.categories.index'); }