Access record data
Is it possible to access the data of a record before returning the form?
4 Replies
you could inject the Component into your required method in your form ( https://filamentphp.com/docs/3.x/forms/advanced#injecting-the-current-livewire-component-instance )
Or if you really need to access the record data, i managed to do that including the form method directly into the view/edit Pages.
there it would not be static anymore so it should have access to the record
You can use mutateFormDataBeforeCreate if you want
This wont be possible inthe create page, as there is no record (therefore null)
Yeah, you are right, I was thinking that by asking to access the data of a record, there must have been a record to begin with, like on the view/edit.
yeah indeeed
if you want to get form data you could use Getter/Set