krayin/laravel-crm · error · InvalidColumnException

Datetime filters will only work with `datetime_range` type.

Error message

Datetime filters will only work with `datetime_range` type. Either remove the `filterable_type` or set it to `datetime_range`.

What it means

Error "Datetime filters will only work with `datetime_range` type. Either remove the `filterable_type` or set it to `datetime_range`." thrown in krayin/laravel-crm.

Source

Thrown at packages/Webkul/DataGrid/src/ColumnTypes/Datetime.php:21

namespace Webkul\DataGrid\ColumnTypes;

use Webkul\DataGrid\Column;
use Webkul\DataGrid\Enums\DateRangeOptionEnum;
use Webkul\DataGrid\Enums\FilterTypeEnum;
use Webkul\DataGrid\Exceptions\InvalidColumnException;

class Datetime extends Column
{
    /**
     * Set filterable type.
     */
    public function setFilterableType(?string $filterableType): void
    {
        if (
            $filterableType
            && ($filterableType !== FilterTypeEnum::DATETIME_RANGE->value)
        ) {
            throw new InvalidColumnException('Datetime filters will only work with `datetime_range` type. Either remove the `filterable_type` or set it to `datetime_range`.');
        }

        parent::setFilterableType($filterableType);
    }

    /**
     * Set filterable options.
     */
    public function setFilterableOptions(mixed $filterableOptions): void
    {
        if (empty($filterableOptions)) {
            $filterableOptions = DateRangeOptionEnum::options();
        }

        parent::setFilterableOptions($filterableOptions);
    }

    /**

View on GitHub (pinned to 13d6988cda)

When it happens

Trigger: Thrown at packages/Webkul/DataGrid/src/ColumnTypes/Datetime.php:21 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of krayin/laravel-crm@13d6988cda (2026-08-17). Data as JSON: /api/errors/68b9cdea18dafbcd. Report an issue: GitHub.