BunsinNANH
1 month ago
349
15
Laravel

Laravel 7 pagination display blank next pages after filter

Posted 1 month ago by BunsinNANH

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'));


}

Please sign in or create an account to participate in this conversation.