Skip to content

Commit

Permalink
Fix image upload during nova creation
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmuscnielsen authored Jul 10, 2020
1 parent cfc311b commit 61552f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Nova/Fields/CloudImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function __construct($name, $attribute = null)
});

$this->store(function (Request $request, Model $model) {
$model->{$this->attribute}->replaceWith(Image::upload($request->file($this->attribute)));

return true;
return function () use ($request, $model) {
$model->{$this->attribute}->replaceWith(Image::upload($request->file($this->attribute)));
};
});

$this->delete(function (Request $request, $model) {
Expand Down

0 comments on commit 61552f1

Please sign in to comment.