F
Filament15mo ago
Omar

how to pass a variable or get a variable from a custom page and get it in a Widget

I have been trying several ways to pass or obtain a variable that I require that is in the custom page where I render the widget but I have not been able to do it, could someone give me an idea on how to do it?
public $form_selected = [];
protected function getFooterWidgets(): array
{
return [
ActivitiesChart::class,
];
}
public $form_selected = [];
protected function getFooterWidgets(): array
{
return [
ActivitiesChart::class,
];
}
1 Reply
Vp
Vp15mo ago
In component $post = Post::first() In blade file <x-filament::page :widget-data="['record' => $post]"> In widget you access in $record
Want results from more Discord servers?
Add your server