Access current record within Widget
Hey, I have a resource like ProductResource and I have an EditProduct page. Within EditProduct I have a Widget like ProductWidget. When on the edit page of that product like /product/1, how can I access the current record (1) from the Widget model? Can't seem to find anything about it in the docs. Thank you.
Solution:Jump to solution
Try to declare public ?Model $record = null; in the widget class, you will have access to the EditProduct record
2 Replies
Solution
Try to declare public ?Model $record = null; in the widget class, you will have access to the EditProduct record
Thanks @David Vincent, works like a charm