F
Filament17mo ago
Vulture

How to hide TableWidget if getTableQuery has no data

Hello, i use HeaderWidgets on Resource Edit Page, i need to hide TableWidget when no data, how to make it ? // EventResource/EditEvent.php
protected function getHeaderWidgets(): array
{
return [
ProcessOverview::class
];
}
protected function getHeaderWidgets(): array
{
return [
ProcessOverview::class
];
}
// GetTableQuery from ProcessOverview TableWidget.
protected function getTableQuery(): Builder
{
return Process::query()->where('event_id', $this->record->id)
->with(['event', 'admin'])
->where('status',ProcessStatusEnum::STARTED->value)
->orderBy('created_at','DESC')
->latest();
}
protected function getTableQuery(): Builder
{
return Process::query()->where('event_id', $this->record->id)
->with(['event', 'admin'])
->where('status',ProcessStatusEnum::STARTED->value)
->orderBy('created_at','DESC')
->latest();
}
1 Reply
Patrick Boivin
Patrick Boivin17mo ago
Maybe you can render an empty Blade view if the table has no data. I'm not sure.
Want results from more Discord servers?
Add your server