bdm-laravel
'Filament\Resources\Pages\ListRecords\Tab' is deprecated
Need alternative for Tab in filament
This is the code
public function getTabs(): array
{
return [
'All' => Tab::make(),
'This Week' => Tab::make()
->modifyQueryUsing(fn (Builder $query) => $query->where('date_hired', '>=', now()->subWeek()))
->badge(Employee::query()->where('date_hired', '>=', now()->subWeek())->count()),
'This Month' => Tab::make()
->modifyQueryUsing(fn (Builder $query) => $query->where('date_hired', '>=', now()->subMonth()))
->badge(Employee::query()->where('date_hired', '>=', now()->subMonth())->count()),
'This Year' => Tab::make()
->modifyQueryUsing(fn (Builder $query) => $query->where('date_hired', '>=', now()->subYear()))
->badge(Employee::query()->where('date_hired', '>=', now()->subYear())->count()),
];
}🙏
1 replies