diff --git a/app/Http/Requests/Api/Application/Users/StoreUserRequest.php b/app/Http/Requests/Api/Application/Users/StoreUserRequest.php index 863cbea74..a1bb8f0e0 100644 --- a/app/Http/Requests/Api/Application/Users/StoreUserRequest.php +++ b/app/Http/Requests/Api/Application/Users/StoreUserRequest.php @@ -21,7 +21,7 @@ class StoreUserRequest extends ApplicationApiRequest 'username', 'password', 'language', - 'root_admin', + 'admin_role_id', ])->toArray(); $response['first_name'] = $rules['name_first']; diff --git a/app/Models/User.php b/app/Models/User.php index 883fa6bf4..86627e4b3 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -94,7 +94,7 @@ class User extends Model implements 'use_totp', 'totp_secret', 'totp_authenticated_at', - 'gravatar', + 'admin_role_id', 'root_admin', ]; @@ -147,6 +147,7 @@ class User extends Model implements 'name_first' => 'required|string|between:1,191', 'name_last' => 'required|string|between:1,191', 'password' => 'sometimes|nullable|string', + 'admin_role_id' => 'sometimes|nullable|exists:admin_roles,id', 'root_admin' => 'boolean', 'language' => 'string', 'use_totp' => 'boolean',