controller
$this->crud->addField([ // Upload
'name' => 'image',
'label' => 'Image',
'type' => 'upload',
'upload' => true,
'disk' => 'uploads' // if you store files in the /public folder, please ommit this; if you store them in /storage or S3, please specify it;
]);
model
public function setImageAttribute($value)
{
$attribute_name = "image";
$disk = "public";
$destination_path = "/uploads";
$this->uploadFileToDisk($value, $attribute_name, $disk, $destination_path);
}
config/filesystem.php
'uploads' => [
'driver' => 'local',
'root' => public_path().'/uploads',
// 'url' => '/photos/',
// 'visibility' => 'public',
],
here is my setting which can successfully access uploaded image:
` ‘uploads’ => [ // used for Backpack/CRUD (in elFinder) ‘driver’ => ‘local’, ‘root’ => public_path(‘/’), ],
$this->crud->addField([ ‘label’ => ‘image’, ‘type’ => ‘upload’, ‘name’ => ‘filename’, ‘upload’ => true, ]);
public function setFilenameAttribute($value) { $attribute_name = “filename”; $disk = “uploads”; $destination_path = “frames_part”;
}
`
Hope it helps
FIRST MAKE SURE THAT THE DISK IS LIKE THIS
and your model like that
can anyone plzz let me know that what changes should i have to do to make my disk as s3
only you can reopen bcz you closed it so
I’m not convinced this is a bug yet.
Do:
(the check from source)
(i.e. check to see if the attribute is there and is a valid file).