You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a suggestion for revision.
In the example, you describe a use case
$ user->update ($request->all());
But I often have a need to pass $ request->book parameters to the update method where the information about the file to be downloaded is kept, for example $request->book->cover
$book->update ($request->book);
But the autoUpload method cannot automatically download this file, because it checks the existence of the file so
I have a suggestion to replace this part of the code, so
if (! empty ($ this-> attributes [$ requestFileName]) and $ this-> attributes [$ requestFileName] instanceof UploadedFile) {
$ this-> uploadImage (
$ this-> attributes [$ requestFileName],
$ field
);
}
As a result, the function will look like this
protected function autoUpload()
{
foreach ($this->getDefinedUploadFields() as $key => $val) {
$field = is_int($key) ? $val : $key;
$options = Arr::wrap($val);
// check if global upload is allowed, then in override in option
$autoUploadAllowed = Arr::get($options, 'auto_upload', $this->canAutoUploadImages());
if (!$autoUploadAllowed) {
continue;
}
// get the input file name
$requestFileName = Arr::get($options, 'file_input', $field);
if (!empty($this->attributes[$requestFileName]) and $this->attributes[$requestFileName] instanceof UploadedFile) {
$this->uploadImage(
$this->attributes[$requestFileName],
$field
);
}
}
}
Do you understand my point?
Can you include this change in the release?
The text was updated successfully, but these errors were encountered:
Hi, Mohd Saqueib Ansari!
Thank you very much for developing this package.
I have a suggestion for revision.
In the example, you describe a use case
$ user->update ($request->all());
But I often have a need to pass $ request->book parameters to the update method where the information about the file to be downloaded is kept, for example $request->book->cover
$book->update ($request->book);
But the autoUpload method cannot automatically download this file, because it checks the existence of the file so
I have a suggestion to replace this part of the code, so
As a result, the function will look like this
Do you understand my point?
Can you include this change in the release?
The text was updated successfully, but these errors were encountered: