|
@@ -39,12 +39,13 @@ class CategoryController extends Controller {
|
|
|
* @return \Illuminate\Http\Response
|
|
|
*/
|
|
|
public function searchBooks(Request $request, Category $category) {
|
|
|
+ $oldSearch = $request->search;
|
|
|
$books = $category->books()
|
|
|
->where('title', 'like', '%' . $request->search . '%')
|
|
|
->orWhere('authors', 'like', '%' . $request->search . '%')
|
|
|
->orWhere('editorial', 'like', '%' . $request->search . '%')
|
|
|
->paginate(6);
|
|
|
- return view('categories.show', compact('category', 'books'));
|
|
|
+ return view('categories.show', compact('category', 'oldSearch', 'books'));
|
|
|
}
|
|
|
|
|
|
/**
|