File: D:/HostingSpaces/SBogers10/rentman2019.komma.pro/app/Komma/JsonApi/JsonApiLengthAwarePaginator.php
<?php
namespace App\Komma\JsonApi;
use Illuminate\Pagination\LengthAwarePaginator;
class JsonApiLengthAwarePaginator extends LengthAwarePaginator
{
/**
* Get the instance as an array.
*
* @return array
*/
public function toArray()
{
return [
'data' => $this->items->toArray(),
'meta' => [
'from' => $this->firstItem(),
'to' => $this->lastItem(),
'per_page' => $this->perPage(),
'current_page' => $this->currentPage(),
'last_page' => $this->lastPage(),
'total' => $this->total(),
],
'links' => [
'self' => $this->url($this->currentPage()),
'first' => $this->url(1),
'prev' => $this->previousPageUrl(),
'next' => $this->nextPageUrl(),
'last' => $this->url($this->lastPage()),
],
];
}
}