LibraryController
extends Controller
in package
Attributes
- #[Middleware]
- ['auth:sanctum', 'ability:' . \App\Models\TokenAbility::ACCESS_API->value, 'force.json']
- #[Prefix]
- '/libraries'
Table of Contents
Methods
- create() : LibraryResource
- Create a new media library
- destroy() : Response
- Delete a library
- index() : AnonymousResourceCollection
- Get a paginated collection of media libraries
- show() : LibraryStatsResource
- Show library with comprehensive statistics
- update() : LibraryResource
- Update an existing library
- denyWithStatus() : mixed
- gateCheckExecuteJob() : mixed
- gateCheckViewDashboard() : mixed
- noContent() : mixed
Methods
create()
Create a new media library
public
create(CreateLibraryRequest $request) : LibraryResource
Creates a new library with the provided configuration. The library will be available for media scanning after creation.
Parameters
- $request : CreateLibraryRequest
Tags
Attributes
- #[Post]
- '/'
- 'api.library.create'
Return values
LibraryResourcedestroy()
Delete a library
public
destroy(string $slug) : Response
Permanently removes a library and all associated data. This action cannot be undone. Media files on disk are not affected, only the library record is removed.
Parameters
- $slug : string
-
The library's URL-friendly identifier
Tags
Attributes
- #[Delete]
- '/{slug}'
- 'api.library.delete'
Return values
Responseindex()
Get a paginated collection of media libraries
public
index(LibraryIndexRequest $request) : AnonymousResourceCollection
Returns a paginated list of all available media libraries with basic information. Does not include detailed statistics - use the show endpoint for comprehensive data.
Parameters
- $request : LibraryIndexRequest
Tags
Attributes
- #[Get]
- '/'
- 'api.libraries.index'
Return values
AnonymousResourceCollectionshow()
Show library with comprehensive statistics
public
show(string $slug) : LibraryStatsResource
Retrieves a single library by its slug identifier and includes both formatted (human-readable) and raw statistical data about the library's content.
Parameters
- $slug : string
-
The library's URL-friendly identifier
Tags
Attributes
- #[Get]
- '/{slug}'
- 'api.library.show'
Return values
LibraryStatsResourceupdate()
Update an existing library
public
update(string $slug, UpdateLibraryRequest $request) : LibraryResource
Updates library configuration using the provided slug identifier. Only the fields included in the request will be updated.
Parameters
- $slug : string
-
The library's URL-friendly identifier
- $request : UpdateLibraryRequest
Tags
Attributes
- #[Patch]
- '/{slug}'
- 'api.library.update'
Return values
LibraryResourcedenyWithStatus()
protected
denyWithStatus(string $message, int $status) : mixed
Parameters
- $message : string
- $status : int
gateCheckExecuteJob()
protected
gateCheckExecuteJob() : mixed
gateCheckViewDashboard()
protected
gateCheckViewDashboard() : mixed
noContent()
protected
noContent() : mixed