*/ public static $model = \App\Models\User::class; /** * The single value that should be used to represent the resource when being displayed. * * @var string */ public static $title = 'name'; /** * The columns that should be searched. * * @var array */ public static $search = [ 'id', 'name', 'email', 'department', 'job_title', ]; /** * Get the fields displayed by the resource. * * @return array */ public function fields(NovaRequest $request): array { return [ ID::make()->sortable(), BelongsTo::make('Role', 'role', RoleResource::class) ->sortable() ->filterable() ->help('The user\'s role, which controls what they can access in the admin panel.'), Text::make('Name') ->sortable() ->rules('required', 'max:255') ->help('The user\'s full name, imported from Azure AD when they first log in.'), 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.'), Text::make('Azure ID', 'azure_id') ->onlyOnDetail() ->copyable() ->help('A unique identifier from Azure AD. Set automatically when the user logs in.'), Text::make('Photo', 'photo') ->onlyOnDetail() ->copyable() ->help('A link to the user\'s profile photo from Azure AD.'), Text::make('Job Title', 'job_title') ->sortable() ->filterable() ->copyable() ->help('The user\'s job title, imported from Azure AD.'), Text::make('Department') ->sortable() ->filterable() ->copyable() ->help('The department the user belongs to, imported from Azure AD.'), Text::make('Phone') ->sortable() ->copyable() ->help('The user\'s phone number, imported from Azure AD.'), Password::make('Password') ->onlyOnForms() ->creationRules($this->passwordRules()) ->updateRules($this->optionalPasswordRules()) ->help('Only needed for admin panel access. Regular users log in via Azure AD and do not need a password.'), ]; } /** * Get the cards available for the request. * * @return array */ public function cards(NovaRequest $request): array { return []; } /** * Get the filters available for the resource. * * @return array */ public function filters(NovaRequest $request): array { return []; } /** * Get the lenses available for the resource. * * @return array */ public function lenses(NovaRequest $request): array { return []; } /** * Get the actions available for the resource. * * @return array */ public function actions(NovaRequest $request): array { return []; } }