UploadField
trait UploadField
Properties
protected string | $directory | Upload directory. |
|
protected null | $name | File name. |
|
protected Filesystem | $storage | Storage instance. |
|
protected bool | $useUniqueName | If use unique name to store upload file. |
|
protected bool | $useSequenceName | If use sequence name to store upload file. |
|
protected bool | $retainable | Retain file when delete record from DB. |
|
protected bool | $downloadable | ||
protected array | $fileActionSettings | Configuration for setting up file actions for newly selected file thumbnails in the preview window. |
|
protected string | $storagePermission | Controls the storage permission. Could be 'private' or 'public'. |
|
protected array | $fileTypes |
Methods
Indicates if the underlying field is downloadable.
Allow use to remove file.
Indicates if the underlying field is retainable.
Set options for file-upload plugin.
Set disk for storage.
Specify the directory and name for upload file.
Specify the directory upload file.
Set name of store name.
Use unique name for store upload file.
Use sequence name for store upload file.
Get directory for store file.
If name already exists, rename it.
Get file visit url.
Destroy original files.
Set file permission when stored into storage.
Initialize the storage instance.
Set default options form image field.
Set preview options form image field.
No description
Get store name of upload file.
Upload file and delete original file.
Generate a unique name for uploaded file.
Generate a sequence name for uploaded file.
Details
at line 101
$this
downloadable(bool $downloadable = true)
Indicates if the underlying field is downloadable.
at line 113
$this
removable()
Allow use to remove file.
at line 125
$this
retainable($retainable = true)
Indicates if the underlying field is retainable.
at line 139
$this
options(array $options = [])
Set options for file-upload plugin.
at line 155
$this
disk(string $disk)
Set disk for storage.
at line 178
$this
move(string $directory, null|string $name = null)
Specify the directory and name for upload file.
at line 194
$this
dir(string $dir)
Specify the directory upload file.
at line 210
$this
name(string|callable $name)
Set name of store name.
at line 224
$this
uniqueName()
Use unique name for store upload file.
at line 236
$this
sequenceName()
Use sequence name for store upload file.
at line 248
mixed|string
getDirectory()
Get directory for store file.
at line 264
void
renameIfExists(UploadedFile $file)
If name already exists, rename it.
at line 278
string
objectUrl($path)
Get file visit url.
at line 296
destroy()
Destroy original files.
at line 318
$this
storagePermission(string $permission)
Set file permission when stored into storage.
at line 330
protected
initStorage()
Initialize the storage instance.
at line 340
protected void
setupDefaultOptions()
Set default options form image field.
at line 373
protected void
setupPreviewOptions()
Set preview options form image field.
at line 383
protected array|bool
guessPreviewType($file)
No description
at line 419
protected string
getStoreName(UploadedFile $file)
Get store name of upload file.
at line 447
protected mixed
upload(UploadedFile $file)
Upload file and delete original file.
at line 465
protected string
generateUniqueName(UploadedFile $file)
Generate a unique name for uploaded file.
at line 477
protected string
generateSequenceName(UploadedFile $file)
Generate a sequence name for uploaded file.