adds roles

This commit is contained in:
2026-02-16 11:19:06 +01:00
parent ebaeb1722d
commit 4dc64c22cb
29 changed files with 495 additions and 89 deletions

View File

@@ -6,6 +6,7 @@
use Illuminate\Http\Request;
use Laravel\Nova\Auth\PasswordValidationRules;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Password;
use Laravel\Nova\Fields\Text;
@@ -35,7 +36,7 @@ final class User extends Resource
* @var array
*/
public static $search = [
'id', 'name', 'email',
'id', 'name', 'email', 'department', 'job_title',
];
/**
@@ -48,6 +49,10 @@ public function fields(NovaRequest $request): array
return [
ID::make()->sortable(),
BelongsTo::make('Role', 'role', RoleResource::class)
->sortable()
->filterable(),
Text::make('Name')
->sortable()
->rules('required', 'max:255'),
@@ -58,6 +63,31 @@ public function fields(NovaRequest $request): array
->creationRules('unique:users,email')
->updateRules('unique:users,email,{{resourceId}}'),
Text::make('Azure ID', 'azure_id')
->onlyOnDetail()
->copyable(),
Text::make('Photo', 'photo')
->onlyOnDetail()
->copyable(),
Text::make('Job Title', 'job_title')
->sortable()
->filterable()
->copyable()
->readonly(),
Text::make('Department')
->sortable()
->filterable()
->copyable()
->readonly(),
Text::make('Phone')
->sortable()
->copyable()
->readonly(),
Password::make('Password')
->onlyOnForms()
->creationRules($this->passwordRules())