components([ TextInput::make('name') ->label('نام') ->required() ->maxLength(255), TextInput::make('email') ->label('ایمیل') ->email() ->required() ->unique(ignoreRecord: true) ->maxLength(255), TextInput::make('mobile') ->label('شماره موبایل') ->tel() ->unique(ignoreRecord: true) ->maxLength(20), TextInput::make('password') ->label('رمز عبور') ->password() ->revealable() ->autocomplete('new-password') ->required(fn (string $operation): bool => $operation === 'create') ->saved(fn (?string $state): bool => filled($state)) ->maxLength(255), CheckboxList::make('roles') ->label('نقش‌ها') ->relationship(titleAttribute: 'name') ->searchable() ->bulkToggleable() ->columns(2), ]); } }