Skip to content

Commit f1873c5

Browse files
gzaidimas
andauthored
Rename export file (MedicOneSystems#341)
* Rename export file * Update LivewireDatatable.php Co-authored-by: dimas <dimas.galih@havasmedia.com>
1 parent 95f25bf commit f1873c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Http/Livewire/LivewireDatatable.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class LivewireDatatable extends Component
5050
public $times;
5151
public $searchable;
5252
public $exportable;
53+
public $export_name;
5354
public $hideable;
5455
public $params;
5556
public $selected = [];
@@ -183,6 +184,7 @@ public function mount(
183184
$hidePagination = null,
184185
$perPage = null,
185186
$exportable = false,
187+
$export_name = null,
186188
$hideable = false,
187189
$beforeTableSlot = false,
188190
$afterTableSlot = false,
@@ -1550,7 +1552,7 @@ public function export()
15501552
})->all();
15511553
});
15521554

1553-
return Excel::download(new DatatableExport($results), 'DatatableExport.xlsx');
1555+
return Excel::download(new DatatableExport($results), $this->export_name ? $this->export_name . '.xlsx' : 'DatatableExport.xlsx');
15541556
}
15551557

15561558
public function getQuery($export = false)

0 commit comments

Comments
 (0)