AlbumController
extends Controller
in package
Attributes
- #[Middleware]
- ['auth:sanctum', 'ability:' . \App\Models\TokenAbility::ACCESS_API->value, 'force.json']
- #[Prefix]
- '/libraries/{library}/albums'
Table of Contents
Methods
- index() : AnonymousResourceCollection
- Get a paginated collection of albums from a specific library
- show() : mixed
- Get a specific album with detailed information
- update() : AlbumResource
- Update an existing album
- denyWithStatus() : mixed
- gateCheckExecuteJob() : mixed
- gateCheckViewDashboard() : mixed
- noContent() : mixed
Methods
index()
Get a paginated collection of albums from a specific library
public
index(Library $library, AlbumIndexRequest $request) : AnonymousResourceCollection
Returns a filtered and paginated list of albums from the specified library. Supports field selection, relation inclusion, and genre filtering for optimized queries.
Parameters
- $library : Library
-
The library to retrieve albums from
- $request : AlbumIndexRequest
-
Request with filtering and pagination parameters
Tags
Attributes
- #[Get]
- '/'
- 'api.albums.index'
Return values
AnonymousResourceCollectionshow()
Get a specific album with detailed information
public
show(Library $library, Album $album) : mixed
Retrieves a single album from the specified library with all related data including artists, cover art, and songs for comprehensive display.
Parameters
Tags
Attributes
- #[Get]
- '{album}'
- 'api.albums.show'
update()
Update an existing album
public
update(Library $library, Album $album, AlbumUpdateRequest $request) : AlbumResource
Updates album metadata and information using the provided data. Only the fields included in the request will be modified.
Parameters
- $library : Library
-
The library containing the album
- $album : Album
-
The album to update
- $request : AlbumUpdateRequest
-
Request containing validated update data
Tags
Attributes
- #[Put]
- '{album}'
- 'api.albums.update'
Return values
AlbumResourcedenyWithStatus()
protected
denyWithStatus(string $message, int $status) : mixed
Parameters
- $message : string
- $status : int
gateCheckExecuteJob()
protected
gateCheckExecuteJob() : mixed
gateCheckViewDashboard()
protected
gateCheckViewDashboard() : mixed
noContent()
protected
noContent() : mixed