F
Filament14mo ago
travis

How to call arbitrary backend code from an Action

Apologies if this has been covered before – I did search and read through the docs but couldn't find a similar use-case (which is surprising, so I suspect I'm using the wrong search terms). I want to create a header action (easy peasy!), which, when clicked on, executes some arbitrary backend code. In my case it's in app/Actions/GitHub/SyncReleaseCandidates.php, which has a handle() method. I happen to be using the https://laravelactions.com/ package but I'm not sure that matters here. I suspect this is just a paradigm/how Filament works kind of question and there's a "right way" to do this. Thanks for any pointers/tips!
Solution:
I think you're looking for action method ```php ->action(function(){ SyncReleaseCandidates::make();...
Jump to solution
2 Replies
Solution
Lara Zeus
Lara Zeus14mo ago
I think you're looking for action method
->action(function(){
SyncReleaseCandidates::make();

// send notification
})
->action(function(){
SyncReleaseCandidates::make();

// send notification
})
travis
travisOP14mo ago
@Lara Zeus Yes – I was just not thinking about this clearly at all! Thank you!
Want results from more Discord servers?
Add your server