Hi Johnny
The inline editing feature is fantastic. I have a custom function to view images from an Upload Field in Laravel’s storage.
When saving the inline editing of another text field that isn’t related to the upload field, it fails.
The controller is named EncuestadorController.php
MY code
$crud->setFieldUpload(‘foto’,‘fotos/’,url(‘/’).‘/encuestador/fotos/’);
$crud->inlineEditFields([‘contacto’]);
public function fotos($foto){
$filename = $foto;
$data = Storage::get('fotos/'.$filename);
return response()->make($data, 200, [
'Content-Type' => 'image/jpeg',
'Content-Disposition' => 'inline; filename="'.$filename.'"'
]);
}
crud->callbackBeforeUpload(function ($uploadData) {
$new_file = bin2hex(random_bytes(4 / 2)) . '_' . $_FILES["data"]["name"]["foto__gcrud_upload"][0];
$_FILES["data"]["name"]["foto__gcrud_upload"][0] = $new_file;
$_FILES["data"]["full_path"]["foto__gcrud_upload"][0] = $new_file;
Storage::putFileAs('fotos/', $_FILES["data"]["tmp_name"]["foto__gcrud_upload"][0], $new_file);
return $uploadData;
});
If the controller class does not have UploadField, everything is fine.