koel/app/Http/Controllers/API/ArtistAlbumController.php

21 lines
461 B
PHP
Raw Normal View History

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