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
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
Attributes
- #[Get]
- '/'
- 'api.genres.index'
Return values
AnonymousResourceCollectionshow()
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
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
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
noContent()
protected
noContent() : mixed