components([ TextInput::make('name') ->label('Imię i nazwisko') ->required() ->maxLength(255), TextInput::make('email') ->label('Email') ->email() ->required() ->maxLength(255) ->unique(ignoreRecord: true), TextInput::make('password') ->label('Hasło') ->password() ->dehydrateStateUsing(fn (?string $state): ?string => $state ? Hash::make($state) : null ) ->required(fn (string $operation): bool => $operation === 'create') ->maxLength(255) ->dehydrated(fn (?string $state): bool => filled($state) ), MultiSelect::make('roles') ->label('Role') ->relationship('roles', 'name') ->preload() ->searchable(), ]); } }