2022-10-18 14:07:41 +00:00
|
|
|
<?php
|
|
|
|
|
2023-06-05 21:46:41 +00:00
|
|
|
namespace App\Http\Controllers\API;
|
2022-10-18 14:07:41 +00:00
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use App\Http\Resources\AlbumResource;
|
|
|
|
use App\Models\Artist;
|
|
|
|
use App\Repositories\AlbumRepository;
|
|
|
|
|
|
|
|
class ArtistAlbumController extends Controller
|
|
|
|
{
|
2024-04-18 14:36:28 +00:00
|
|
|
public function __construct(private readonly AlbumRepository $albumRepository)
|
2022-10-18 14:07:41 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function index(Artist $artist)
|
|
|
|
{
|
|
|
|
return AlbumResource::collection($this->albumRepository->getByArtist($artist));
|
|
|
|
}
|
|
|
|
}
|