Laravel pagination not working with array instead of collection
I'm trying to paginate an array data set and it has proven more challenging than I thought. I'm using Laravel 5 So I have an abstract interface/repository that all my other models extend to and I created a method inside my abstract repository call paginate. I've included both use Illuminate\Pagination\Paginator; and use Illuminate\Pagination\LengthAwarePaginator; Here is the method public function paginate($items,$perPage,$pageStart=1) { // Start displaying items from this number; $offSet = ($pageStart * $perPage) - $perPage; // Get only the items you need using array_slice