*/ 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, 'length' => $this->album->length, 'play_count' => (int) $this->album->play_count, 'song_count' => (int) $this->album->song_count, ]; } }