Laravel 7 pagination display blank next pages after filter
When filtering the data it has been returned well with paginate but when clicking the next pages it returned blank pages.
My controller function
public function filter(Request $request)
{
$cat_id = $request->input('cat_id');
$categories = Category::where('cat_id','LIKE','%'.$cat_id .'%')->paginate(10);
return view('myview', compact('categories'));
}
the code above did not seem so....
show your code with appends()...
here
public function filter(Request $request) {
$cat_id = $request->input('cat_id');
$categories = Category::where('cat_id','LIKE','%'.$cat_id .'%')->paginate(10);
$pagination = $categories->appends(array('cat_id' => $cat_id));
return view('myview', compact('categories'));
}
unlikely to be related, but you should fix your webserver
You should not see public in the url - it should be the root folder. You will continue to have strange issues until you fix this.
Do you still have issues if you run php artisan serve and then access the url it gives you?
Yes, it still errors when I click to go to the next pages.
Any solution to suggest me.
I ready installed the Laravel Telescope package but when it scanning too slow not show anything it just scanning.
all both above it working but what my problem is with pagination. The data retrieve as normally but the pagination is not working for the next pages.
Thanks, but it still the same issue
Please or to participate in this conversation.