Ensure the UUID is set correctly; closes #2450

This commit is contained in:
Dane Everitt 2020-10-10 17:11:27 -07:00
parent a9e4587125
commit 1f28fb94e2
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -102,9 +102,11 @@ class MountController extends Controller
public function create(MountFormRequest $request) public function create(MountFormRequest $request)
{ {
/** @var \Pterodactyl\Models\Mount $mount */ /** @var \Pterodactyl\Models\Mount $mount */
$mount = Mount::query()->create(array_merge($request->validated(), [ $model = (new Mount())->fill($request->validated());
'uuid' => Uuid::uuid4()->toString(), $model->forceFill(['uuid' => Uuid::uuid4()->toString()]);
]));
$model->saveOrFail();
$mount = $model->fresh();
$this->alert->success('Mount was created successfully.')->flash(); $this->alert->success('Mount was created successfully.')->flash();