akbsit / nova-field-system-file
Uploading files to the server from nova.
Installs: 36
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Language:Vue
Requires
- php: ^8.1
- akbsit/laravel-system-file: ^1.0
- laravel/framework: ^9.0|^10.0|^11.0
- laravel/nova: ^3.0|^4.0
README
Install
To install package, you need run command:
composer require akbsit/nova-field-system-file
Next install migrations:
php artisan migrate
Connection
Package based on akbsit/laravel-system-file in repository which describes the connection to the model.
Examples
Second parameter is responsible for the collection to which the saved images or files will belong.
- Upload image:
public function fields(HttpRequest $oHttpRequest) { return [ Image::make(__('Image'), 'image'), ]; }
- Upload file:
public function fields(HttpRequest $oHttpRequest) { return [ File::make(__('File'), 'file'), ]; }
- Fields support validation via the method
rules
:
public function fields(HttpRequest $oHttpRequest) { return [ Image::make(__('Image'), 'image') ->rules('required', 'max:1000'), File::make(__('File'), 'file') ->rules('required', 'max:5000'), ]; }
Methods and properties
enablePartition()
- enable folder generation (example:73c/d53/dce
);setOriginFileName(string $sOriginFileName)
- set origin file name;setFileName(string $sFileName)
- set file name;toDir(string $sDir)
- set storage folder (by defaultdefault
);self()
- specified if the modelSystemFile
(by defaultfalse
).