SongController
extends Controller
in package
Attributes
- #[Middleware]
- ['force.json']
- #[Prefix]
- '/libraries/{library}/songs'
Table of Contents
Methods
- index() : JsonAnonymousResourceCollection
- Get a paginated collection of songs from a specific library
- show() : SongResource
- Get a specific song by its public identifier
- denyWithStatus() : mixed
- gateCheckExecuteJob() : mixed
- gateCheckViewDashboard() : mixed
- noContent() : mixed
Methods
index()
Get a paginated collection of songs from a specific library
public
index(SongIndexRequest $request, Library $library) : JsonAnonymousResourceCollection
Returns a filtered and paginated list of songs from the specified library. Supports relation inclusion and genre filtering. Songs are ordered by album title and track number for a consistent browsing experience.
Parameters
- $request : SongIndexRequest
-
Request with filtering and pagination parameters
- $library : Library
-
The library to retrieve songs from
Tags
Attributes
- #[Get]
- ''
- 'api.songs.index'
- ['auth:sanctum', 'ability:' . TokenAbility::ACCESS_API->value]
Return values
JsonAnonymousResourceCollectionshow()
Get a specific song by its public identifier
public
show(SongShowRequest $request, Library $library, string $publicId) : SongResource
Retrieves a single song from the specified library using its public ID. Supports relation inclusion for comprehensive song information including artists, album data, genres, and audio metadata.
Parameters
- $request : SongShowRequest
-
Request with optional relation parameters
- $library : Library
-
The library containing the song
- $publicId : string
-
The public identifier of the song to retrieve
Tags
Attributes
- #[Get]
- '{publicId}'
- 'api.songs.show'
- ['auth:sanctum', 'ability:' . TokenAbility::ACCESS_API->value]
Return values
SongResourcedenyWithStatus()
protected
denyWithStatus(string $message, int $status) : mixed
Parameters
- $message : string
- $status : int
gateCheckExecuteJob()
protected
gateCheckExecuteJob() : mixed
gateCheckViewDashboard()
protected
gateCheckViewDashboard() : mixed
noContent()
protected
noContent() : mixed