mirror of
https://github.com/koel/koel
synced 2024-12-23 11:03:05 +00:00
25 lines
550 B
PHP
25 lines
550 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\V6\API;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Resources\AlbumResource;
|
|
use App\Models\Album;
|
|
use App\Repositories\AlbumRepository;
|
|
|
|
class AlbumController extends Controller
|
|
{
|
|
public function __construct(private AlbumRepository $repository)
|
|
{
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
return AlbumResource::collection($this->repository->paginate());
|
|
}
|
|
|
|
public function show(Album $album)
|
|
{
|
|
return AlbumResource::make($this->repository->getOne($album->id));
|
|
}
|
|
}
|