From 61552f10033c2e2ea1e302e3762a51f067eb2108 Mon Sep 17 00:00:00 2001 From: Rasmus Nielsen Date: Fri, 10 Jul 2020 09:25:59 +0200 Subject: [PATCH] Fix image upload during nova creation --- src/Nova/Fields/CloudImage.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) {