Bånder

Library extends BaseModel
in package
uses HasFactory, HasSlug, HasLibraryStats, HasMeta

Table of Contents

Properties

$dateFormat  : mixed
$fillable  : mixed
$meta  : array<string|int, mixed>
Dynamic meta properties that can be serialized

Methods

albums()  : mixed
clearMeta()  : self
Clear all meta properties
formatForException()  : string
getAllMeta()  : array<string|int, mixed>
Get all meta properties
getDashboardData()  : array<string|int, mixed>
Get a summary dashboard for this library
getDisk()  : mixed
getFormattedStats()  : FormattedLibraryStats
Get formatted library statistics and store them in meta
getMeta()  : T|null
Get a typed meta property
getMetaAsType()  : T|null
Get a meta property with type assertion
getMetaKeys()  : array<string|int, mixed>
Get meta property names (keys)
getRawStats()  : LibraryStats
Get raw library statistics and store them in meta
getRouteKeyName()  : string
getSlugOptions()  : SlugOptions
Get the options for generating the slug.
hasAnyMeta()  : bool
Check if any meta properties exist
hasMeta()  : bool
Check if a meta property exists
newEloquentBuilder()  : mixed
removeMeta()  : self
Remove a meta property
setMeta()  : self
Set a meta property with type safety
setMultipleMeta()  : self
Set multiple meta properties at once
toArray()  : array<string|int, mixed>
Convert the model instance to an array including meta properties
update()  : mixed
updateLastScan()  : void
users()  : mixed
formatBytes()  : string
Format bytes to human readable format
formatDuration()  : string
Format duration in seconds to human readable format
getStats()  : array<string|int, mixed>
Get comprehensive library statistics from database

Properties

$dateFormat

protected mixed $dateFormat = 'Y-m-d H:i:sO'

$fillable

protected mixed $fillable = ['name', 'slug', 'path', 'type', 'order', 'last_scan']

$meta

Dynamic meta properties that can be serialized

protected array<string|int, mixed> $meta = []

Methods

clearMeta()

Clear all meta properties

public clearMeta() : self
Return values
self

formatForException()

public formatForException() : string
Return values
string

getAllMeta()

Get all meta properties

public getAllMeta() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDashboardData()

Get a summary dashboard for this library

public getDashboardData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMeta()

Get a typed meta property

public getMeta(MetaKey|string $key[, T|null $default = null ]) : T|null
Parameters
$key : MetaKey|string

The meta property key

$default : T|null = null

Default value if key doesn't exist

Tags
template
Return values
T|null

getMetaAsType()

Get a meta property with type assertion

public getMetaAsType(MetaKey|string $key, T> $type[, T|null $default = null ]) : T|null
Parameters
$key : MetaKey|string

The meta property key

$type : T>

Expected type class

$default : T|null = null

Default value if key doesn't exist

Tags
template
Return values
T|null

getMetaKeys()

Get meta property names (keys)

public getMetaKeys() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRouteKeyName()

public getRouteKeyName() : string
Return values
string

getSlugOptions()

Get the options for generating the slug.

public getSlugOptions() : SlugOptions
Return values
SlugOptions

hasAnyMeta()

Check if any meta properties exist

public hasAnyMeta() : bool
Return values
bool

hasMeta()

Check if a meta property exists

public hasMeta(MetaKey|string $key) : bool
Parameters
$key : MetaKey|string

The meta property key

Return values
bool

newEloquentBuilder()

public newEloquentBuilder(mixed $query) : mixed
Parameters
$query : mixed

removeMeta()

Remove a meta property

public removeMeta(MetaKey|string $key) : self
Parameters
$key : MetaKey|string

The meta property key to remove

Return values
self

setMeta()

Set a meta property with type safety

public setMeta(MetaKey|string $key, T $value) : self
Parameters
$key : MetaKey|string

The meta property key

$value : T

The meta property value

Tags
template
Return values
self

setMultipleMeta()

Set multiple meta properties at once

public setMultipleMeta(array<string|int, mixed> $meta) : self
Parameters
$meta : array<string|int, mixed>
Return values
self

toArray()

Convert the model instance to an array including meta properties

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

update()

public update([array<string|int, mixed> $attributes = [] ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$attributes : array<string|int, mixed> = []
$options : array<string|int, mixed> = []

updateLastScan()

public updateLastScan([Carbon|null $date = null ]) : void
Parameters
$date : Carbon|null = null

formatBytes()

Format bytes to human readable format

private formatBytes(int $bytes) : string
Parameters
$bytes : int
Return values
string

formatDuration()

Format duration in seconds to human readable format

private formatDuration(int $seconds) : string
Parameters
$seconds : int
Return values
string

getStats()

Get comprehensive library statistics from database

private getStats() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results