From c74b904f141a6deb4e63d7cc2ba10bda938f1ee5 Mon Sep 17 00:00:00 2001 From: Daniel Meltzer Date: Tue, 28 Apr 2020 11:27:44 -0400 Subject: [PATCH] Fix Location parent different validation on new location creation. --- app/Http/Controllers/LocationsController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Http/Controllers/LocationsController.php b/app/Http/Controllers/LocationsController.php index 5d76d59e67cd..86476867c118 100755 --- a/app/Http/Controllers/LocationsController.php +++ b/app/Http/Controllers/LocationsController.php @@ -67,6 +67,7 @@ public function store(ImageUploadRequest $request) { $this->authorize('create', Location::class); $location = new Location(); + $location->id = null; // This is required to make Laravels different validation work, it errors if the parameter doesn't exist (maybe a bug)? $location->name = $request->input('name'); $location->parent_id = $request->input('parent_id', null); $location->currency = $request->input('currency', '$');