Skip to content

Commit 37e31d4

Browse files
committed
Use new getTableId() method.
1 parent 17f796c commit 37e31d4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ php artisan migrate
4848
1. Add the export-button livewire component on your view file that uses dataTable class.
4949

5050
```phpt
51-
<livewire:export-button :table-id="$dataTable->getTableAttribute('id')" />
51+
<livewire:export-button :table-id="$dataTable->getTableId()" />
5252
```
5353

5454
2. On your `DataTable` class instance, use `WithExportQueue`
@@ -71,19 +71,19 @@ class PermissionsDataTable extends DataTable
7171
You can set the export filename by setting the property.
7272

7373
```phpt
74-
<livewire:export-button :table-id="$dataTable->getTableAttribute('id')" filename="my-table.xlsx" />
75-
<livewire:export-button :table-id="$dataTable->getTableAttribute('id')" filename="my-table.csv" />
74+
<livewire:export-button :table-id="$dataTable->getTableId()" filename="my-table.xlsx" />
75+
<livewire:export-button :table-id="$dataTable->getTableId()" filename="my-table.csv" />
7676

77-
<livewire:export-button :table-id="$dataTable->getTableAttribute('id')" :filename="$filename" />
77+
<livewire:export-button :table-id="$dataTable->getTableId()" :filename="$filename" />
7878
```
7979

8080
## Export Type
8181

8282
You can set the export type by setting the property to `csv` or `xlsx`. Default value is `csv`.
8383

8484
```phpt
85-
<livewire:export-button :table-id="$dataTable->getTableAttribute('id')" type="xlsx" />
86-
<livewire:export-button :table-id="$dataTable->getTableAttribute('id')" type="csv" />
85+
<livewire:export-button :table-id="$dataTable->getTableId()" type="xlsx" />
86+
<livewire:export-button :table-id="$dataTable->getTableId()" type="csv" />
8787
```
8888

8989

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"require": {
1818
"php": ">=7.4|8.*",
1919
"yajra/laravel-datatables-buttons": "4.*",
20+
"yajra/laravel-datatables-html": "^4.40",
2021
"maatwebsite/excel": "^3.0",
2122
"livewire/livewire": "^2.6",
2223
"laravel/framework": "^8.61"

0 commit comments

Comments
 (0)