Skip to content

Commit

Permalink
Issue krayin#1660 fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
suraj-webkul committed Sep 30, 2024
1 parent e1ec37c commit a5c5a38
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions packages/Webkul/Admin/src/DataGrids/Settings/AttributeDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\DB;
use Webkul\Attribute\Repositories\AttributeRepository;
use Webkul\DataGrid\DataGrid;

class AttributeDataGrid extends DataGrid
Expand Down Expand Up @@ -66,17 +67,24 @@ public function prepareColumns(): void
'index' => 'entity_type',
'label' => trans('admin::app.settings.attributes.index.datagrid.entity-type'),
'type' => 'string',
'sortable' => true,
'searchable' => false,
'filterable' => true,
'closure' => fn ($row) => ucfirst($row->entity_type),
]);

$this->addColumn([
'index' => 'type',
'label' => trans('admin::app.settings.attributes.index.datagrid.type'),
'type' => 'string',
'sortable' => true,
'filterable' => true,
'index' => 'type',
'label' => trans('admin::app.settings.attributes.index.datagrid.type'),
'type' => 'string',
'sortable' => true,
'filterable' => true,
'filterable_type' => 'dropdown',
'filterable_options' => app(AttributeRepository::class)
->select('type as label', 'type as value')
->distinct()
->get()
->toArray(),
]);

$this->addColumn([
Expand Down

0 comments on commit a5c5a38

Please sign in to comment.