Property | Type | Description | |
---|---|---|---|
$config | Illuminate\Contracts\Cache\Repository | ||
$customProperties | array | ||
$diskName | string | ||
$file | string | Symfony\Component\HttpFoundation\File\UploadedFile | ||
$fileName | string | ||
$filesystem | |||
$mediaName | string | ||
$pathToFile | string | ||
$preserveOriginal | boolean | ||
$properties | array | ||
$subject | subject |
Method | Description | |
---|---|---|
__construct ( |
||
preservingOriginal ( ) | When adding the file to the media library, the original file will be preserved. | |
setFile ( string | Symfony\Component\HttpFoundation\File\UploadedFile $file ) | Set the file that needs to be imported. | |
setFileName ( string $fileName ) | Set the name of the file that is stored on disk. | |
setName ( string $name ) | Set the name of the media object. | |
setSubject ( |
||
toCollection ( string $collectionName = 'default', string $diskName = '' ) : |
Set the collection name where to import the file. | |
toCollectionOnDisk ( string $collectionName = 'default', string $diskName = '' ) : |
||
toMediaLibrary ( string $collectionName = 'default', string $diskName = '' ) : |
Set the target media collection to default. | |
toMediaLibraryOnDisk ( string $collectionName = 'default', string $diskName = '' ) : |
Set the target media collection to default. | |
usingFileName ( string $fileName ) | Set the name of the file that is stored on disk. | |
usingName ( string $name ) | Set the name of the media object. | |
withAttributes ( array $properties ) | Set attributes on the model. | |
withCustomProperties ( array $customProperties ) | Set the metadata. | |
withProperties ( array $properties ) | Set properties on the model. |
Method | Description | |
---|---|---|
determineDiskName ( string $diskName ) : string | Determine the disk to be used. | |
sanitizeFileName ( string $fileName ) : string | Sanitize the given file name. |
public __construct ( |
||
$fileSystem | ||
$config | Illuminate\Contracts\Cache\Repository |
protected determineDiskName ( string $diskName ) : string | ||
$diskName | string | |
return | string |
public preservingOriginal ( ) |
protected sanitizeFileName ( string $fileName ) : string | ||
$fileName | string | |
return | string |
public setFileName ( string $fileName ) | ||
$fileName | string |
public setSubject ( |
||
$subject | ||
return |
public toCollection ( string $collectionName = 'default', string $diskName = '' ) : |
||
$collectionName | string | |
$diskName | string | |
return |
public toCollectionOnDisk ( string $collectionName = 'default', string $diskName = '' ) : |
||
$collectionName | string | |
$diskName | string | |
return |
public toMediaLibrary ( string $collectionName = 'default', string $diskName = '' ) : |
||
$collectionName | string | |
$diskName | string | |
return |
public toMediaLibraryOnDisk ( string $collectionName = 'default', string $diskName = '' ) : |
||
$collectionName | string | |
$diskName | string | |
return |
public usingFileName ( string $fileName ) | ||
$fileName | string |
public withAttributes ( array $properties ) | ||
$properties | array |
public withCustomProperties ( array $customProperties ) | ||
$customProperties | array |
public withProperties ( array $properties ) | ||
$properties | array |
protected Repository,Illuminate\Contracts\Cache $config | ||
return | Illuminate\Contracts\Cache\Repository |
protected string|UploadedFile,Symfony\Component\HttpFoundation\File $file | ||
return | string | Symfony\Component\HttpFoundation\File\UploadedFile |
protected Filesystem,Spatie\MediaLibrary $filesystem | ||
return |