Adds the user name as a separate field

This commit is contained in:
2026-03-19 11:57:27 +01:00
parent a046c017fa
commit 124c707634
9 changed files with 233 additions and 21 deletions

View File

@@ -36,7 +36,7 @@ final class User extends Resource
* @var array
*/
public static $search = [
'id', 'name', 'email', 'department', 'job_title',
'id', 'name', 'username', 'email', 'department', 'job_title',
];
/**
@@ -59,12 +59,19 @@ public function fields(NovaRequest $request): array
->rules('required', 'max:255')
->help('The user\'s full name, imported from Azure AD when they first log in.'),
Text::make('Username')
->sortable()
->rules('required', 'max:255')
->creationRules('unique:users,username')
->updateRules('unique:users,username,{{resourceId}}')
->help('The user\'s Azure AD principal name (UPN), used to identify them when logging in via SSO.'),
Text::make('Email')
->sortable()
->rules('required', 'email', 'max:254')
->creationRules('unique:users,email')
->updateRules('unique:users,email,{{resourceId}}')
->help('The user\'s email address, used to identify them when logging in via Azure AD.'),
->help('The user\'s email address.'),
Text::make('Azure ID', 'azure_id')
->onlyOnDetail()