koel/app/Http/Controllers/V6/API/AlbumController.php

26 lines
550 B
PHP
Raw Normal View History

2022-06-10 10:47:46 +00:00
<?php
namespace App\Http\Controllers\V6\API;
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
{
public function __construct(private AlbumRepository $repository)
{
2022-06-10 10:47:46 +00:00
}
public function index()
{
return AlbumResource::collection($this->repository->paginate());
2022-06-10 10:47:46 +00:00
}
public function show(Album $album)
{
return AlbumResource::make($this->repository->getOne($album->id));
2022-06-10 10:47:46 +00:00
}
}