Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

unopim/unopim

7807 stars
2 code files
View unopim/unopim on GitHub

packages/Webkul/DataGrid/src/Enums/ColumnTypeEnum.php

Open in GitHub
enum ColumnTypeEnum: string
{
case STRING = 'string';
 
case INTEGER = 'integer';
 
case BOOLEAN = 'boolean';
 
case DROPDOWN = 'dropdown';
 
case DATE_RANGE = 'date_range';
 
case DATE_TIME_RANGE = 'datetime_range';
}

packages/Webkul/DataGrid/src/Column.php

Open in GitHub
use Webkul\DataGrid\Enums\ColumnTypeEnum;
 
class Column
{
// ...
 
public function init(): void
{
$this->setDatabaseColumnName();
 
switch ($this->type) {
case ColumnTypeEnum::BOOLEAN->value:
$this->setFormOptions($this->getBooleanOptions());
 
break;
 
case ColumnTypeEnum::DROPDOWN->value:
$this->setFormOptions($this->options);
 
break;
 
case ColumnTypeEnum::DATE_RANGE->value:
$this->setFormInputType(FormInputTypeEnum::DATE->value);
 
$this->setFormOptions($this->getRangeOptions());
 
break;
 
case ColumnTypeEnum::DATE_TIME_RANGE->value:
$this->setFormInputType(FormInputTypeEnum::DATE_TIME->value);
 
$this->setFormOptions($this->getRangeOptions('Y-m-d H:i:s'));
 
break;
}
}
 
// ...
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.