Bånder

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
throws
ValidationException

When both genreNames and genreSlugs are provided

response

JsonAnonymousResourceCollection<JsonPaginator<SongResource>>

Attributes
#[Get]
''
'api.songs.index'
['auth:sanctum', 'ability:' . TokenAbility::ACCESS_API->value]
Return values
JsonAnonymousResourceCollection

show()

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
throws
ModelNotFoundException

When song is not found

response

SongResource

Attributes
#[Get]
'{publicId}'
'api.songs.show'
['auth:sanctum', 'ability:' . TokenAbility::ACCESS_API->value]
Return values
SongResource

denyWithStatus()

protected denyWithStatus(string $message, int $status) : mixed
Parameters
$message : string
$status : int

gateCheckExecuteJob()

protected gateCheckExecuteJob() : mixed

gateCheckViewDashboard()

protected gateCheckViewDashboard() : mixed

        
On this page

Search results