Resource, custom page with widgets, how to sent the $record ?

Hey guys, I've created a custom page on a Resource, but on the widgets I would like to get the record, do you know how to do it ?
class ChartOrganization extends Page
{
protected static string $resource = OrganizationResource::class;

protected static string $view = 'filament.resources.organization-resource.pages.chart-organization';

public ?Organization $record;

protected function getHeaderWidgets(): array
{
return [
OrganizationResource\Widgets\QuotaWidget::class, // $this->record is null inside the widget.
];
}
}
class ChartOrganization extends Page
{
protected static string $resource = OrganizationResource::class;

protected static string $view = 'filament.resources.organization-resource.pages.chart-organization';

public ?Organization $record;

protected function getHeaderWidgets(): array
{
return [
OrganizationResource\Widgets\QuotaWidget::class, // $this->record is null inside the widget.
];
}
}
1 Reply
Vp
Vp13mo ago
In custom page define like this, Note: This is how I used in v2, hope it still work in v3
<x-filament::page :widget-data="['record' => $data]">
<x-filament::page :widget-data="['record' => $data]">
You need to define $data in your custom page on resource
Want results from more Discord servers?
Add your server