메소드 |
설명 |
|
addMedia ( string | Symfony\Component\HttpFoundation\File\UploadedFile $file ) : FileAdder |
Add a file to the medialibrary. |
|
addMediaConversion ( string $name ) : Conversion |
*
Add a conversion. |
|
addMediaFromRequest ( string $key ) : FileAdder |
Add a file from a request. |
|
addMediaFromUrl ( string $url ) : FileAdder |
Add a remote file to the medialibrary. |
|
bootHasMediaTrait ( ) |
|
|
clearMediaCollection ( string $collectionName = 'default' ) |
Remove all media in the given collection. |
|
copyMedia ( string | Symfony\Component\HttpFoundation\File\UploadedFile $file ) : FileAdder |
Copy a file to the medialibrary. |
|
deleteMedia ( integer | Media $mediaId ) |
Delete the associated media with the given id. |
|
deletePreservingMedia ( ) : boolean |
Delete the model, but preserve all the associated media. |
|
getFirstMedia ( string $collectionName = 'default', array $filters = [] ) : Media | null |
Get the first media item of a media collection. |
|
getFirstMediaPath ( string $collectionName = 'default', string $conversionName = '' ) : string |
*
Get the url of the image for the given conversionName
for first media for the given collectionName. |
|
getFirstMediaUrl ( string $collectionName = 'default', string $conversionName = '' ) : string |
*
Get the url of the image for the given conversionName
for first media for the given collectionName. |
|
getMedia ( string $collectionName = '', $filters = [] ) : Collection |
*
Get media collection by its collectionName. |
|
hasMedia ( string $collectionName = '' ) : boolean |
*
Determine if there is media in the given collection. |
|
media ( ) : mixed |
Set the polymorphic relation. |
|
shouldDeletePreservingMedia ( ) : Media |
Determines if the media files should be preserved when the media object gets deleted. |
|
updateMedia ( array $newMediaArray, string $collectionName = 'default' ) : array |
Update a media collection by deleting and inserting again with new values. |
|