adds roles
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user