triad-ltd / array-files
A Laravel Nova field.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Vue
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2025-01-12 06:56:19 UTC
README
A laravel nova field that will let you save your uploaded files path to your database in array format.
Installation
Usage
Create array images just call TriadLtd\ArrayFiles\ArrayFiles
class and use make
static method to create a field.
...
use TriadLtd\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": "/storage/original-file-name.pdf",
"name": "original-file-name.pdf"
}, {
"url": "/storage/original-file-name.docx",
"name": "original-file-name.docx"
}, {
"url": "/storage/original-file-name.zip",
"name": "original-file-name.zip"
}]
Notes
- make sure you have specified correct
APP_URL
on your application - make sure you have specified default
FILESYSTEM_DRIVER
on your application