Shawdow
175
6
Laravel

This page isn’t working 127.0.0.1 redirected you too many times pagination error

Posted 5 months ago by Shawdow

adding the pagination for filters when it redirects to second page returns error

This page isn’t working 127.0.0.1 redirected you too many times.

controller file

function category(Request $request){

        $pro_category = $request->input('category');

        $flag = $request->input('flag');

        $pro_category = category:where('pro_category', $pro_category )->paginate(10);


        if($flag === "ajax"){

            return view('product', compact('pro_category'))->render();

        }else{

            return redirect('/pro_category?cat='.$pro_category.'&page='.$request->page);

        }

}

blade pagination link

  {!! pro_category->appends(['cat => $cat->pro_demand])->links() !!}

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

Reply to

Use Markdown with GitHub-flavored code blocks.