How to get current record on Table action using a custom form field
Hi,
I have a Resource with a Table action using a custom field. I need pass data to the view for this action - all works well for user details but how do I pass the current record’s ID? I’ve tried lots of approaches but it never passes the data
I know I can get the record in my BraintreePayment Blade using
recordId: '{{ $getRecord()->id }}'
but this doesn’t work for me as I want to pass in an object of data to make the component describing the type of payment being made more reusable for different situations.1 Reply
Thinking about this a but more, the other option would be to access the record in the Field’s class
class BraintreePayment extends Field
but calling $this->getRecord()
errors: Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization