PHP Class Spatie\MediaLibrary\Media

Inheritance: extends Illuminate\Database\Eloquent\Model, use trait SortableTrait
Afficher le fichier Open project: spatie/laravel-medialibrary Class Usage Examples

Protected Properties

Свойство Type Description
$casts array The attributes that should be casted to native types.
$guarded

Méthodes publiques

Méthode Description
getCustomProperty ( string $propertyName, mixed $default = null ) : mixed Get if the value of custom property with the given name.
getDiskDriverName ( ) : string
getExtensionAttribute ( ) : string
getHumanReadableSizeAttribute ( ) : string
getImageGenerators ( ) : Collection Collection of all ImageGenerator drivers.
getMediaConversionNames ( ) : array * Get all the names of the registered media conversions.
getMimeAttribute ( ) : string
getPath ( string $conversionName = '' ) : string Get the original path to a media-file.
getTypeAttribute ( ) : string Determine the type of a file.
getTypeFromExtensionAttribute ( ) : string Determine the type of a file from its file extension.
getTypeFromMimeAttribute ( ) : string * Determine the type of a file from its mime type
getUrl ( string $conversionName = '' ) : string Get the original Url to a media-file.
hasCustomProperty ( string $propertyName ) : boolean * Determine if the media item has a custom property with the given name.
model ( ) : Illuminate\Database\Eloquent\Relations\MorphTo Create the polymorphic relation.
removeCustomProperty ( string $name )
setCustomProperty ( string $name, mixed $value )

Method Details

getCustomProperty() public méthode

Get if the value of custom property with the given name.
public getCustomProperty ( string $propertyName, mixed $default = null ) : mixed
$propertyName string
$default mixed
Résultat mixed

getDiskDriverName() public méthode

public getDiskDriverName ( ) : string
Résultat string

getExtensionAttribute() public méthode

public getExtensionAttribute ( ) : string
Résultat string

getHumanReadableSizeAttribute() public méthode

getImageGenerators() public méthode

Collection of all ImageGenerator drivers.
public getImageGenerators ( ) : Collection
Résultat Illuminate\Support\Collection

getMediaConversionNames() public méthode

* Get all the names of the registered media conversions.
public getMediaConversionNames ( ) : array
Résultat array

getMimeAttribute() public méthode

public getMimeAttribute ( ) : string
Résultat string

getPath() public méthode

Get the original path to a media-file.
public getPath ( string $conversionName = '' ) : string
$conversionName string
Résultat string

getTypeAttribute() public méthode

Determine the type of a file.
public getTypeAttribute ( ) : string
Résultat string

getTypeFromExtensionAttribute() public méthode

Determine the type of a file from its file extension.

getTypeFromMimeAttribute() public méthode

* Determine the type of a file from its mime type
public getTypeFromMimeAttribute ( ) : string
Résultat string

getUrl() public méthode

Get the original Url to a media-file.
public getUrl ( string $conversionName = '' ) : string
$conversionName string
Résultat string

hasCustomProperty() public méthode

* Determine if the media item has a custom property with the given name.
public hasCustomProperty ( string $propertyName ) : boolean
$propertyName string
Résultat boolean

model() public méthode

Create the polymorphic relation.
public model ( ) : Illuminate\Database\Eloquent\Relations\MorphTo
Résultat Illuminate\Database\Eloquent\Relations\MorphTo

removeCustomProperty() public méthode

public removeCustomProperty ( string $name )
$name string

setCustomProperty() public méthode

public setCustomProperty ( string $name, mixed $value )
$name string
$value mixed

Property Details

$casts protected_oe property

The attributes that should be casted to native types.
protected array $casts
Résultat array

$guarded protected_oe property

protected $guarded