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:
Try to declare public ?Model $record = null; in the widget class, you will have access to the EditProduct record
Jump to solution
2 Replies
Solution
David Vincent
David Vincent9mo ago
Try to declare public ?Model $record = null; in the widget class, you will have access to the EditProduct record
erigra.
erigra.OP9mo ago
Thanks @David Vincent, works like a charm
Want results from more Discord servers?
Add your server