_jimmy
_jimmy
FFilament
Created by _jimmy on 10/24/2023 in #❓┊help
Controlling modals in an action
Figured it out. Just throw a halt exception, throw new Halt(); in your custom function from the Filament\Support\Exceptions\Halt namespace. In my case, the custom function was modified as:
use Filament\Support\Exceptions\Halt;

public function updateNotes(string $notes)
{
try {
// call api endpoint
} catch (Exception $e) {
// log
// notify
throw new Halt();
}
}
use Filament\Support\Exceptions\Halt;

public function updateNotes(string $notes)
{
try {
// call api endpoint
} catch (Exception $e) {
// log
// notify
throw new Halt();
}
}
This prevents the modal from closing.
6 replies
FFilament
Created by _jimmy on 10/24/2023 in #❓┊help
Controlling modals in an action
so validation would work however, in this case, the $this->updateNotes method is a call to an api endpoint, which decides if success or not.
6 replies
FFilament
Created by _jimmy on 8/10/2023 in #❓┊help
How is everyone handling input sanitization to prevent XSS and such?
Thanks, thats what I'll do, just wasn't sure if there was a better way or a Filament way
4 replies