Open a filament modal in beforeCreate() lifecycle hook

Is there a way to open a filament modal on a Create Resource, panel, page Like
public function beforeCreate()
{
if($foo) {
//open modal
$this-halt();
}
}
public function beforeCreate()
{
if($foo) {
//open modal
$this-halt();
}
}
Solution:
I finally remembered it was mountAction() I was looking for. ```php //use Filament\Actions\Action; ...
Jump to solution
1 Reply
Solution
Stockholm
Stockholm11mo ago
I finally remembered it was mountAction() I was looking for.
//use Filament\Actions\Action;

public function fooAction(): Action
{
return Action::make('foo');
//->action(...)
}

protected function beforeCreate(): ?Action
{
if (true) {
$this->mountAction('foo');
$this->halt();
}
}
//use Filament\Actions\Action;

public function fooAction(): Action
{
return Action::make('foo');
//->action(...)
}

protected function beforeCreate(): ?Action
{
if (true) {
$this->mountAction('foo');
$this->halt();
}
}
Want results from more Discord servers?
Add your server