UploadsContract
Table of Contents
Methods
- handleUpload() : mixed
- This hook will receive every file found in your request and you can handle it as you wish.
- defaultUpload() : string
- This hook will receive every file found in your request and you can handle it as you wish.
Methods
handleUpload()
This hook will receive every file found in your request and you can handle it as you wish.
public
abstract handleUpload(UploadedFile $file, string $fileName) : mixed
Whatever you return here is what we shall send to the db. Returning null or false will skip the file in the entire request from being saved in the db.
Parameters
- $file : UploadedFile
-
The file object that was uploaded.
- $fileName : string
-
The name as defined in the request.
Return values
mixed —The value to be saved in the db, null or false to skip the file, or an exception to stop the entire request
defaultUpload()
This hook will receive every file found in your request and you can handle it as you wish.
protected
defaultUpload(UploadedFile $file, string $fileName) : string
Whatever you return here is what we shall send to the db. Returning null or false will skip the file in the entire request from being saved in the db.
Parameters
- $file : UploadedFile
-
The file object that was uploaded.
- $fileName : string
-
The name as defined in the request.
Tags
Return values
string —The value to be saved in the db, null or false to skip the file, or an exception to stop the entire request