From 1f28fb94e245a12f713fe400b02a5954f4694733 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 10 Oct 2020 17:11:27 -0700 Subject: [PATCH] Ensure the UUID is set correctly; closes #2450 --- app/Http/Controllers/Admin/MountController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Admin/MountController.php b/app/Http/Controllers/Admin/MountController.php index 520b08d1..3f40e555 100644 --- a/app/Http/Controllers/Admin/MountController.php +++ b/app/Http/Controllers/Admin/MountController.php @@ -102,9 +102,11 @@ class MountController extends Controller public function create(MountFormRequest $request) { /** @var \Pterodactyl\Models\Mount $mount */ - $mount = Mount::query()->create(array_merge($request->validated(), [ - 'uuid' => Uuid::uuid4()->toString(), - ])); + $model = (new Mount())->fill($request->validated()); + $model->forceFill(['uuid' => Uuid::uuid4()->toString()]); + + $model->saveOrFail(); + $mount = $model->fresh(); $this->alert->success('Mount was created successfully.')->flash();