Forms\Components\TextInput::make('email')
->email()
->required()
->unique(Guest::class, 'email', ignoreRecord: true)
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$guest = Guest::where('email', $state)->first();
if($guest) {
$set('name', $guest->name);
$set('telephone', $guest->telephone);
// Show Modal here
\Filament\Notifications\Notification::make()
->title('¡Cuenta existente!')
->body('Esta cuenta ya está registrada en nuestro sistema.')
->seconds(5)
->danger()
->send();
}
})
->columnSpan(1),
Forms\Components\TextInput::make('email')
->email()
->required()
->unique(Guest::class, 'email', ignoreRecord: true)
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$guest = Guest::where('email', $state)->first();
if($guest) {
$set('name', $guest->name);
$set('telephone', $guest->telephone);
// Show Modal here
\Filament\Notifications\Notification::make()
->title('¡Cuenta existente!')
->body('Esta cuenta ya está registrada en nuestro sistema.')
->seconds(5)
->danger()
->send();
}
})
->columnSpan(1),