Bånder

GenreController extends Controller
in package

Attributes
#[Middleware]
['auth:sanctum', 'ability:' . \App\Models\TokenAbility::ACCESS_API->value, 'force.json']
#[Prefix]
'/genres'

Table of Contents

Methods

delete()  : mixed
Delete a genre
index()  : AnonymousResourceCollection
Get a paginated collection of music genres
show()  : mixed
Get a specific genre with detailed information
update()  : mixed
Update an existing genre
denyWithStatus()  : mixed
gateCheckExecuteJob()  : mixed
gateCheckViewDashboard()  : mixed
noContent()  : mixed

Methods

delete()

Delete a genre

public delete(Genre $genre) : mixed

Permanently removes a genre from the system. This action will also remove the genre association from all related albums and songs.

Parameters
$genre : Genre

The genre to delete

Tags
throws
ModelNotFoundException

When genre is not found

status

204

Attributes
#[Delete]
'/{genre}'
'api.genres.destroy'

index()

Get a paginated collection of music genres

public index(GenreIndexRequest $request) : AnonymousResourceCollection

Returns a filtered and paginated list of all music genres in the system. Supports field selection and library filtering for optimized queries.

Parameters
$request : GenreIndexRequest

Request with filtering and pagination parameters

Tags
response

AnonymousResourceCollection<JsonPaginator<GenreResource>>

Attributes
#[Get]
'/'
'api.genres.index'
Return values
AnonymousResourceCollection

show()

Get a specific genre with detailed information

public show(Genre $genre) : mixed

Retrieves a single genre with comprehensive information including associated artists, albums, and usage statistics.

Parameters
$genre : Genre

The genre to retrieve

Tags
throws
ModelNotFoundException

When genre is not found

response

GenreResource

Attributes
#[Get]
'{genre}'
'api.genres.show'

update()

Update an existing genre

public update(UpdateGenreRequest $request, Genre $genre) : mixed

Updates genre information including name, description, and metadata. Only the fields included in the request will be modified.

Parameters
$request : UpdateGenreRequest

Request containing validated update data

$genre : Genre

The genre to update

Tags
throws
ModelNotFoundException

When genre is not found

response

GenreResource

Attributes
#[Patch]
'/{genre}'
'api.genres.update'

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