From 647e9975b2a8a7edc9dc3218431c97f11148ebdf Mon Sep 17 00:00:00 2001 From: milewski Date: Sun, 6 Oct 2019 11:12:39 +0800 Subject: [PATCH] Fix bug where other inputs would throw validation error when uploading files --- src/Http/Controllers/FilepondController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Http/Controllers/FilepondController.php b/src/Http/Controllers/FilepondController.php index 8a1c675..d9a9475 100644 --- a/src/Http/Controllers/FilepondController.php +++ b/src/Http/Controllers/FilepondController.php @@ -7,6 +7,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Routing\Controller as BaseController; +use Illuminate\Support\Arr; use Illuminate\Support\Facades\Storage; use Illuminate\Validation\ValidationException; use Laravel\Nova\Http\Requests\NovaRequest; @@ -35,7 +36,7 @@ public function process(Request $request) $resourceClass = Nova::resourceForKey($resourceName); $rules = $resourceClass::rulesForCreation(app(NovaRequest::class)); - $this->validate($request, $rules); + $this->validate($request, Arr::only($rules, $request->input('attribute'))); } catch (ValidationException $exception) {