How to bind the filters of a filament table created in a livewire component with a widget?

I have made a custom filament table inside a livewire component. I have made it and its working as intented. I have also made a widget that i want to bind to this table so that when i change the filters etc the stats will be automatically updated. In the filament table i have
class ReportsFilament extends Component implements HasForms, HasTable
{
use InteractsWithForms;
use InteractsWithTable;
use ExposesTableToWidgets;
class ReportsFilament extends Component implements HasForms, HasTable
{
use InteractsWithForms;
use InteractsWithTable;
use ExposesTableToWidgets;
and in the widget i have
class OrderStatsOverview extends BaseWidget
{
use InteractsWithPageTable;
protected static ?string $pollingInterval = null;

protected function getTablePage(): string
{
return ReportsFilament::class;
}

protected function getStats(): array
{
return [
Stat::make('Σύνολο παραγγελιών', $this->getPageTableQuery()->count()),
];
}

}
class OrderStatsOverview extends BaseWidget
{
use InteractsWithPageTable;
protected static ?string $pollingInterval = null;

protected function getTablePage(): string
{
return ReportsFilament::class;
}

protected function getStats(): array
{
return [
Stat::make('Σύνολο παραγγελιών', $this->getPageTableQuery()->count()),
];
}

}
In the view now i have a Livewire component and inside the view of it i call
@livewire('reports-filament')
@livewire('reports-filament')
also inside another div on this view that i call the widget
@livewire(\App\Livewire\OrderStatsOverview::class)
@livewire(\App\Livewire\OrderStatsOverview::class)
But i get Cannot assign null to property App\Livewire\OrderStatsOverview::$tableColumnSearches of type array Is there something else i need to do in order to achieve what i want? Its not inside a resource because i have a table inside a livewire component which i have made using this https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server