Skip to content
Advertisement

Call to undefined method IlluminateDatabaseEloquentBuilder::links() error when attempting to paginate

I’m trying to create a simple filter system with a search box, service, category and a way to sort the items in my laravel controller. However, I am getting an error links() when I try to filter anything even though I think I have paginated correctly. Here’s my function:

JavaScript

Can anyone give me some advice on this problem? Thanks!

Edit:

Here is my search page:

JavaScript

Advertisement

Answer

You need to assign the value :

JavaScript

if you don’t do that your paginator instance is lost and you end up with a builder in the view which has no links method

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement