I'm using Eloquent ORM v5.8.29 without Laravel in my PHP project. I've done so by including "illuminate/database": "^5.8"
in my composer.json file. It's been working fine so far, creating models and executing Eloquent statements on those Models to get the data I want out of my MySQL database. However, whenever I try to use the pagination feature from Eloquent, I run into trouble.
Example code
class UseCaseController
{
public function getAllPaginated($amountItems)
{
return UseCase::where('active', '1')->paginate($amountItems);
}
}
PhpStorm IDE throws the following error:
Undefined class Paginator
I've tried a few suggestions for other paths, but no easy fix has presented itself. There seems to be pagination included with Eloquent, so I'm assuming this works without Laravel or Blade templating. Am I wrong here? Is Laravel a required component, or am I doing something else wrong?