Problem in accessing widget current record
https://filamentphp.com/docs/3.x/panels/resources/widgets#accessing-the-current-record-in-the-widget
Can someone help me explain more about accessing widget current record?
My widget class:
I get error
Unable to resolve dependency [Parameter #0 [ <required> $record ]] in class Widget
What should I do?
Solution:Jump to solution
If not, then you have to define/pass data like this https://filamentphp.com/docs/3.x/panels/resources/widgets#passing-properties-to-widgets-on-resource-pages
5 Replies
Did you try to remove your « mount » function ?
yes I did, but $this->record is null
Did you use this inside "EDIT" or "VIEW" as mentioned in docs linked
Solution
If not, then you have to define/pass data like this https://filamentphp.com/docs/3.x/panels/resources/widgets#passing-properties-to-widgets-on-resource-pages
thanks, that what I need..