From e7821d4c80c6c9d335c2e4b58b0d9f3436a670af Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 4 Jun 2024 19:21:38 +1000 Subject: [PATCH] Fix for user creation --- app/Http/Requests/UserRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/UserRequest.php b/app/Http/Requests/UserRequest.php index 8fc6a17..9474c15 100644 --- a/app/Http/Requests/UserRequest.php +++ b/app/Http/Requests/UserRequest.php @@ -21,7 +21,7 @@ class UserRequest extends FormRequest $o = $this->route('o'); return [ - 'email' => 'required|email|unique:users,email,'.($o->exists ? $o->id : 0), + 'email' => 'required|email|unique:users,email,'.($o?->exists ? $o->id : 0), 'name' => 'required|min:3', 'pgp_pubkey' => [ 'nullable', @@ -33,7 +33,7 @@ class UserRequest extends FormRequest 'admin' => 'required|boolean', 'system_id' => [ 'nullable', - Rule::in($o->systems->pluck('id')), + Rule::in($o?->systems->pluck('id')), ], ]; }