$this->collection->map(function ($article) { return new ArticleBaseResource($article); }), 'page' => $this->page(), ]; } protected function page(): array { return [ 'current' => $this->currentPage(), 'total_page' => $this->lastPage(), 'per_page' => $this->perPage(), 'has_more' => $this->hasMorePages(), 'total' => $this->total(), ]; } }