#Where to customize filter notif badge count

5 messages · Page 1 of 1 (latest)

versed brook
#

The value stays 0 even when I filter things, is there any way to customize or remove it

vale viper
#

Which filters are you using? I can't replicate with the demo

versed brook
versed brook
# vale viper Which filters are you using? I can't replicate with the demo

Filter with Select in it like this

Filter::make('expired_in')
                ->label('Expired dalam')
                ->form([
                    Select::make('range')
                        ->label('Expired dalam')
                        ->options([
                            30 => '< 30 hari',
                            14 => '< 14 hari',
                            7  => '< 7 hari',
                            3  => '< 3 hari',
                        ])
                        ->native(false)
                        ->columnSpan(1),
                ])
                ->query(function (Builder $query, array $data) {
                    $days = (int) ($data['range'] ?? 0);
                    if ($days <= 0) {
                        return $query;
                    }

                    $now = Carbon::today();

                    return $query
                        ->whereNotNull('ended_at')
                        ->whereDate('ended_at', '>=', $now)
                        ->whereDate('ended_at', '<=', $now->copy()->addDays($days));
                }),