Skip to content
Advertisement

Call to undefined method links()

I’m trying to display featured game in my home page but i’m getting the error :

Call to undefined method IlluminateDatabaseEloquentBuilder::links() when i’m changing in the HomeController :

From

JavaScript

To

JavaScript

HomeController

JavaScript

2020_04_09_073846_create_products_table

JavaScript

{{ $homes->links() }} in the home.blade.php (at the end of the html of course)

So every game is at 0, so it should be display a page empty whithout any game.

The pagination works fine without changing the line in the HomeController but when i’m changing to $home = Product::where('featured', 'true');. It’s not working.

What I tried :

Put 5, 10 or 20 games at 1 in the featured column but same error.

Put $home = Product::where('featured', 'true')->paginate($pagination); but it shows me every game that i have…

Thanks for your help.

Advertisement

Answer

Try this:

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