Uploading a file
Define a file field in the model.
Reading a file from a model
$image holds the image represented by the Admin\Helpers\File class, which simplifies rendering the file in a template and working with it.

src attribute holds the full path to the file, for example https://example.com/uploads/.../my-uploaded-file.png.
Resizing images
The Admin\Helpers\File class can resize images directly in the template.resize($width, $height) takes the width as its first argument and the height as its second. With both defined, the image is cropped to the correct ratio. With only one defined, the other is calculated from the ratio.
The crop runs on the first request for the image and is stored on the server for later requests.
Advanced image operations
The File class uses Intervention Image, so it can perform any operation that library supports. Theimage($mutators) method takes an array whose keys are the function names and whose values are the arguments of those functions.
Helper methods
delete
Removes the file from the server.download
Returns a link that forces the browser to download the file instead of displaying it.filesize
Returns the exact file size in B/Kb/Mb/Gb depending on its size.false for the raw size.