Nullable DateTime Filter Value on Table Filter (v3)

Hi there, I have a table with three inputs:

With Trashed
Created At (from)
Created At (to)

The filters work but when I don't use the created_at filter, it defaults to null where it throws an exception:
Could not parse 'null': Failed to parse time string (null) at position 0 (n): The timezone could not be found in the database

The generated URL: admin/users?tableFilters[trashed][value]=1&tableFilters[Created%20At][created_from]=null&tableFilters[Created%20At][created_until]=null

This works on v2 but doesn't work on v3. Any ideas?

Filter:
$this->form([
    DatePicker::make('created_from')->label('Created From'),
    DatePicker::make('created_until')->label('Created Until'),
]);

$this->query(function (Builder $query, array $data): Builder {
    return $query
        ->when(
            $data['created_from'],
            fn (Builder $query, $date): Builder => $query->whereDate('created_at', '>=', $date),
        )
        ->when(
            $data['created_until'],
            fn (Builder $query, $date): Builder => $query->whereDate('created_at', '<=', $date),
        );
});
Was this page helpful?