A Laravel Nova field for distribute your files as array of object.
halimtuhu/array-files is a Laravel package for a laravel nova field for distribute your files as array of object..
It currently has 7 GitHub stars and 3.740 downloads on Packagist (latest version v1.0).
Install it with composer require halimtuhu/array-files.
Discover more Laravel packages by halimtuhu
or browse all Laravel packages to compare alternatives.
Last updated
A laravel nova field that will let you save your uploaded files path to your database in array format.
composer require halimtuhu/array-files
Create array files just call Halimtuhu\ArrayFiles\ArrayFiles class and use make static method to create a field.
...
use Halimtuhu\ArrayFiles\ArrayFiles;
...
public function fields(Request $request)
{
return [
...
ArrayFiles::make('Files', 'files'),
...
];
}
...
That will create a field with name Files. Stored data will look like this.
[{
"url": "http://laranov.halimtuhu.test/storage/wB04AbprHGxHw4I3sizXmuw9L4LBcG0wv0QEacAo.pdf",
"name": "wB04AbprHGxHw4I3sizXmuw9L4LBcG0wv0QEacAo.pdf"
}, {
"url": "http://laranov.halimtuhu.test/storage/eOuxUCjHGNokkHdOXYB7gGObxCvf7m30ridFpBpy.pdf",
"name": "eOuxUCjHGNokkHdOXYB7gGObxCvf7m30ridFpBpy.pdf"
}, {
"url": "http://laranov.halimtuhu.test/storage/nLkZp4vfpATEp56NStJfeAtKoHvmN2hapfxoNrEN.doc",
"name": "nLkZp4vfpATEp56NStJfeAtKoHvmN2hapfxoNrEN.doc"
}]
Specify disk target for uploaded images.
ArrayFiles::make('Files', 'files')
->disk('public'),
If not specified then the default disk will be used.
Specify target path for uploaded images.
ArrayFiles::make('Files', 'files')
->disk('public')
->path('files'),
If not specified then default path on selected disk will be used.
APP_URL on your applicationFILESYSTEM_DRIVER on your application