koel/app/Http/Controllers/API/ArtistController.php
2024-07-06 17:44:58 +02:00

25 lines
535 B
PHP

<?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use App\Http\Resources\ArtistResource;
use App\Models\Artist;
use App\Repositories\ArtistRepository;
class ArtistController extends Controller
{
public function __construct(private readonly ArtistRepository $repository)
{
}
public function index()
{
return ArtistResource::collection($this->repository->paginate());
}
public function show(Artist $artist)
{
return ArtistResource::make($artist);
}
}