Embed Notification Action

I'm at a loss on this one. I have a notification that pops up and halts a Create form when no credit exists. I then have a button to request a credit limit. I cannot seem to fire off said custom action. for the moment I have a die() in place.
protected function beforeCreate(): void
{
$credit = new CreditLimitReport($this->data['client_id']);
if(!$credit->isLive)
{
Notification::make()
->warning()
->title('Credit not set')
->actions([
Action::make('request_credit')
->label('Request Credit')
->action(function(){
die('test');
}) ,
])
->send();
$this->halt();
}
}
protected function beforeCreate(): void
{
$credit = new CreditLimitReport($this->data['client_id']);
if(!$credit->isLive)
{
Notification::make()
->warning()
->title('Credit not set')
->actions([
Action::make('request_credit')
->label('Request Credit')
->action(function(){
die('test');
}) ,
])
->send();
$this->halt();
}
}
1 Reply
David | Fortune Validator
The die('test') never happens. Okay so I swear I always find the answer after posting for help. This did the ticket:
->dispatch('sendCreditRequest', ['client_id'=>$this->data['client_id']]),
->dispatch('sendCreditRequest', ['client_id'=>$this->data['client_id']]),
Want results from more Discord servers?
Add your server