2022-06-10 12:47:46 +02:00
|
|
|
<?php
|
|
|
|
|
2023-06-05 23:46:41 +02:00
|
|
|
namespace App\Http\Controllers\API;
|
2022-06-10 12:47:46 +02:00
|
|
|
|
2022-07-29 08:47:10 +02:00
|
|
|
use App\Http\Controllers\Controller;
|
2022-06-10 12:47:46 +02:00
|
|
|
use App\Http\Resources\ArtistResource;
|
|
|
|
use App\Models\Artist;
|
|
|
|
use App\Repositories\ArtistRepository;
|
|
|
|
|
|
|
|
class ArtistController extends Controller
|
|
|
|
{
|
2024-04-18 16:36:28 +02:00
|
|
|
public function __construct(private readonly ArtistRepository $repository)
|
2022-07-27 17:32:36 +02:00
|
|
|
{
|
2022-06-10 12:47:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function index()
|
|
|
|
{
|
2022-10-11 17:28:43 +02:00
|
|
|
return ArtistResource::collection($this->repository->paginate());
|
2022-06-10 12:47:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function show(Artist $artist)
|
|
|
|
{
|
2024-01-01 21:38:41 +01:00
|
|
|
return ArtistResource::make($artist);
|
2022-06-10 12:47:46 +02:00
|
|
|
}
|
|
|
|
}
|