Adding a resource widget to an infolist viewentry/blade file

I created a resource widget which displays a barchart. It works as intended when using the getHeaderWidgets() function on the resource pages. I created an infolist on the resource entry's view page which uses a blade file to display some information. The problem is that if i were to use @livewire(\App\Filament\Resources\TestResource\Widgets\TestWidget::class) for example, it loads the widget but the widget no longer detects the current resource that is being displayed ($this->record is null). I was wondering if there's a way to make a call to the widget while maintaining the link to the current resource entry so I can display the barchart for whatever entry a user is viewing.
Solution:
Have you tried something like this?
@livewire(TestWidget::class, ['record' => $getRecord()])
@livewire(TestWidget::class, ['record' => $getRecord()])
...
Jump to solution
1 Reply
Solution
Patrick Boivin
Patrick Boivin15mo ago
Have you tried something like this?
@livewire(TestWidget::class, ['record' => $getRecord()])
@livewire(TestWidget::class, ['record' => $getRecord()])
Want results from more Discord servers?
Add your server