[ '*' => self::JSON_STRUCTURE, ], 'links' => [ 'first', 'last', 'prev', 'next', ], 'meta' => [ 'current_page', 'from', 'path', 'per_page', 'to', ], ]; public function __construct(private readonly Album $album) { parent::__construct($album); } /** @return array */ public function toArray($request): array { return [ 'type' => 'albums', 'id' => $this->album->id, 'name' => $this->album->name, 'artist_id' => $this->album->artist_id, 'artist_name' => $this->album->artist->name, 'cover' => $this->album->cover, 'created_at' => $this->album->created_at, ]; } }