koel/app/Http/Controllers/API/ArtistController.php
2023-06-05 23:46:41 +02:00

25 lines
557 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 ArtistRepository $repository)
{
}
public function index()
{
return ArtistResource::collection($this->repository->paginate());
}
public function show(Artist $artist)
{
return ArtistResource::make($this->repository->getOne($artist->id));
}
}