Tables\Actions\DeleteAction::make() before or after method How to access record value inside?
I am trying to build validation before deleting the record from the table .. How do I access the record values inside the before function? Any help please.. thank you!
Tables\Actions\DeleteAction::make()
->before(function () { // $deleted_record = $this->record ???
}
3 Replies
Solution
function ($record) { ... }
Thank you! Thank you! you are beautiful soul!
There are a bunch more possible things you can access just by following the right naming. Here's a list for things in Tables, but they apply in other places too: https://filamentphp.com/docs/3.x/tables/columns/advanced#injecting-the-current-eloquent-record