Bånder

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

destroy()

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

When library is not found

status

204

Attributes
#[Delete]
'/{slug}'
'api.library.delete'
Return values
Response

index()

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
response

AnonymousResourceCollection<JsonPaginator<LibraryResource>>

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

show()

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

When library is not found

response

LibraryStatsResource

Attributes
#[Get]
'/{slug}'
'api.library.show'
Return values
LibraryStatsResource

update()

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

When library is not found

response

LibraryResource

Attributes
#[Patch]
'/{slug}'
'api.library.update'
Return values
LibraryResource

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