diff --git a/src/Nova/Fields/CloudImage.php b/src/Nova/Fields/CloudImage.php index 9d2ce0a..2e6217d 100644 --- a/src/Nova/Fields/CloudImage.php +++ b/src/Nova/Fields/CloudImage.php @@ -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) {