protected function filterQuery(&$query, $filters) {
        $table = $this->model->getTable();
        foreach ($filters as $property => $value) {
            $type = DB::connection()->getDoctrineColumn($table, $property)->getType()->getName();

            $property = $table . '.' . $property;

            if (str_contains($type, 'time')) {
                $start = date('Y-m-d H:i:s', strtotime($value->start));
                $end = date('Y-m-d H:i:s', strtotime($value->end));
                $query->whereBetween($property, array($start, $end));
            } else if ($type === 'integer') {
                $query->where($property, $value);
            } else {
                $query->where($property, 'ilike', '%' . $value . '%');
            }
        }

        return $query;
    }