Reputation: 859
my controller code is
$enquiries = Enquiry::paginate(5);
return view('admin.enquiry-list')->withResults($enquiries);
my blade.php code is like this
{{ $enquiries->appends(Request::only('fullname',
'mobile',
'email'))->links() }}
where am i doing wrong?
Upvotes: 0
Views: 542
Reputation: 838
the links should not be treated as an html entity
$enquiries = Enquiry::paginate(5);
return view('admin.enquiry-list')->with('enquiries',$enquiries);
{!! $enquiries->appends(Request::only('fullname',
'mobile',
'email'))->links() !!}
Upvotes: 0
Reputation: 570
If you refer to Laravel documentation, here Is what it says:
Appending To Pagination Links
You may append to the query string of pagination links using the appends method. For example, to append sort=votes to each pagination link, you should make the following call to appends:
{{ $users->appends(['sort' => 'votes'])->links() }}
Based on it I feel what you are missing is Parameters supplied to the appends should be array. Can you try changing it to an Array ?
{{ $enquiries->appends(Request::only(['fullname',
'mobile',
'email']))->links() }}
Can you try checking if this works ?
Upvotes: 0