2022-06-10 10:47:46 +00:00
|
|
|
<?php
|
|
|
|
|
2023-06-05 21:46:41 +00:00
|
|
|
namespace App\Http\Controllers\API;
|
2022-06-10 10:47:46 +00:00
|
|
|
|
2022-07-29 06:47:10 +00:00
|
|
|
use App\Http\Controllers\Controller;
|
2022-06-10 10:47:46 +00:00
|
|
|
use App\Http\Resources\AlbumResource;
|
|
|
|
use App\Models\Album;
|
|
|
|
use App\Repositories\AlbumRepository;
|
|
|
|
|
|
|
|
class AlbumController extends Controller
|
|
|
|
{
|
2022-10-11 15:28:43 +00:00
|
|
|
public function __construct(private AlbumRepository $repository)
|
2022-07-08 14:53:04 +00:00
|
|
|
{
|
2022-06-10 10:47:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function index()
|
|
|
|
{
|
2022-10-11 15:28:43 +00:00
|
|
|
return AlbumResource::collection($this->repository->paginate());
|
2022-06-10 10:47:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function show(Album $album)
|
|
|
|
{
|
2024-01-01 20:38:41 +00:00
|
|
|
return AlbumResource::make($album);
|
2022-06-10 10:47:46 +00:00
|
|
|
}
|
|
|
|
}
|