Group::make()
->schema([
Section::make()
->schema([
TextInput::make('name')->label('Full Name'),
TextInput::make('email')->label('Email'),
TextInput::make('password')->label('Password')
->password()
->dehydrateStateUsing(fn (string $state): string => Hash::make($state))
->dehydrated(fn (?string $state): bool => filled($state)),
Select::make('roles')
->native(false)
->relationship('roles', 'name')
->live()
->searchDebounce(500)
]),
Section::make()
->schema([
TextInput::make('user_rate')->label('Rate')
->numeric(),
TextInput::make('user_distance_rate')->label('Rate Per Distance')
->numeric(),
Toggle::make('user_preferred')->label('Preferred'),
])
->visible(fn (Get $get): bool => $get('roles') == 2)
]),
Group::make()
->schema([
Section::make()
->schema([
TextInput::make('name')->label('Full Name'),
TextInput::make('email')->label('Email'),
TextInput::make('password')->label('Password')
->password()
->dehydrateStateUsing(fn (string $state): string => Hash::make($state))
->dehydrated(fn (?string $state): bool => filled($state)),
Select::make('roles')
->native(false)
->relationship('roles', 'name')
->live()
->searchDebounce(500)
]),
Section::make()
->schema([
TextInput::make('user_rate')->label('Rate')
->numeric(),
TextInput::make('user_distance_rate')->label('Rate Per Distance')
->numeric(),
Toggle::make('user_preferred')->label('Preferred'),
])
->visible(fn (Get $get): bool => $get('roles') == 2)
]),