You need to call ->paginate() on your DB query or Eloquent Query https://laravel.com/docs/10.x/pagination
You should call paginate
method to retrieve the records from your route handler or controller.
For example in your controller you are retriving the $inventory
data like this:
$inventory = Inventory::all();
or
$inventory = Inventory::query()->get();
This should be changed to something like this:
$inventory = Inventory::query()->paginate();
You will get the access to the links
method only if you are fetching data using paginate
or simplePaginate
method.
See more details here: https://laravel.com/docs/10.x/pagination#paginating-eloquent-results
How are you retrieving the data for the $inventory
variable?
Your database query or Eloquent Query needs to be paginated; see https://laravel.com/docs/10.x/pagination
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community