Skip to content

Commit 7e4c61c

Browse files
Merge pull request #144 from shubhwebkul/136
#136 resolved
2 parents be4501f + 5acc25e commit 7e4c61c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/Webkul/Admin/src/DataGrids/Lead/LeadDataGrid.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ class LeadDataGrid extends DataGrid
1111

1212
protected $tabFilters = [];
1313

14-
protected $stagesMassActionOptions;
15-
1614
protected $redirectRow = [
1715
"id" => "id",
1816
"route" => "admin.leads.view",
@@ -161,6 +159,12 @@ public function prepareActions()
161159

162160
public function prepareMassActions()
163161
{
162+
$stages = [];
163+
164+
foreach (app("\Webkul\Lead\Repositories\StageRepository")->get(['id', 'name'])->toArray() as $stage) {
165+
$stages[$stage['name']] = $stage['id'];
166+
}
167+
164168
$this->addMassAction([
165169
'type' => 'delete',
166170
'label' => trans('ui::app.datagrid.delete'),
@@ -173,7 +177,7 @@ public function prepareMassActions()
173177
'label' => trans('admin::app.datagrid.update_stage'),
174178
'action' => route('admin.leads.mass_update'),
175179
'method' => 'PUT',
176-
'options' => $this->stagesMassActionOptions,
180+
'options' => $stages,
177181
]);
178182
}
179183
}

0 commit comments

Comments
 (0)