mirror of
https://github.com/koel/koel
synced 2024-12-24 03:23:06 +00:00
25 lines
560 B
PHP
25 lines
560 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\V6\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));
|
|
}
|
|
}
|