I am attempting to upload a file (country flag) to a simple table countries which should be saved in a "flags" folder of public.
In my add field declaration I have
$this->crud->addField([ // image
'label' => "flag",
'name' => "flag",
'type' => 'image',
'upload' => true,
'disk' => 'flags', // in case you need to show images from a different disk
'prefix' => 'flags/'
and in the filesystems file I have:
'flags' => [
'driver' => 'local',
'root' => public_path('flags'),
'url' => '/flags',
'visibility' => 'public',
],
When I upload it tells me that the field is too short (it is varchar 255) as it seems to want to store the file as data image.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire