7
7
[ ![ Total Downloads] ( https://img.shields.io/packagist/dt/yajra/laravel-datatables-export.svg )] ( https://packagist.org/packages/yajra/laravel-datatables-export )
8
8
[ ![ License] ( https://img.shields.io/github/license/mashape/apistatus.svg )] ( https://packagist.org/packages/yajra/laravel-datatables-export )
9
9
10
- This package is a plugin of [ Laravel DataTables] ( https://github.com/yajra/laravel-datatables ) for handling server-side exporting using Queue, OpenSpout and Livewire.
10
+ This package is a plugin of [ Laravel DataTables] ( https://github.com/yajra/laravel-datatables ) for handling server-side
11
+ exporting using Queue, OpenSpout and Livewire.
11
12
12
13
## Requirements
13
14
@@ -22,6 +23,14 @@ This package is a plugin of [Laravel DataTables](https://github.com/yajra/larave
22
23
23
24
- [ Laravel DataTables Documentation] ( http://yajrabox.com/docs/laravel-datatables )
24
25
26
+ ## Laravel Version Compatibility
27
+
28
+ | Laravel | Package |
29
+ | :--------| :--------|
30
+ | 8.x | 0.x |
31
+ | 9.x | 1.x |
32
+ | 10.x | 10.x |
33
+
25
34
## Quick Installation
26
35
27
36
` composer require yajra/laravel-datatables-export `
@@ -46,7 +55,8 @@ php artisan migrate
46
55
1 . Add the export-button livewire component on your view file that uses dataTable class.
47
56
48
57
``` html
49
- <livewire:export-button :table-id =" $dataTable->getTableId()" />
58
+
59
+ <livewire:export-button :table-id =" $dataTable->getTableId()" />
50
60
```
51
61
52
62
2 . On your ` DataTable ` class, use ` WithExportQueue `
@@ -77,27 +87,30 @@ $schedule->command('datatables:purge-export')->weekly();
77
87
You can set the export filename by setting the property.
78
88
79
89
``` html
80
- <livewire:export-button :table-id =" $dataTable->getTableId()" filename =" my-table.xlsx" />
81
- <livewire:export-button :table-id =" $dataTable->getTableId()" filename =" my-table.csv" />
82
90
83
- <livewire:export-button :table-id =" $dataTable->getTableId()" :filename =" $filename" />
91
+ <livewire:export-button :table-id =" $dataTable->getTableId()" filename =" my-table.xlsx" />
92
+ <livewire:export-button :table-id =" $dataTable->getTableId()" filename =" my-table.csv" />
93
+
94
+ <livewire:export-button :table-id =" $dataTable->getTableId()" :filename =" $filename" />
84
95
```
85
96
86
97
## Export Type
87
98
88
99
You can set the export type by setting the property to ` csv ` or ` xlsx ` . Default value is ` xlsx ` .
89
100
90
101
``` html
91
- <livewire:export-button :table-id =" $dataTable->getTableId()" type =" xlsx" />
92
- <livewire:export-button :table-id =" $dataTable->getTableId()" type =" csv" />
102
+
103
+ <livewire:export-button :table-id =" $dataTable->getTableId()" type =" xlsx" />
104
+ <livewire:export-button :table-id =" $dataTable->getTableId()" type =" csv" />
93
105
```
94
106
95
107
## Set Excel Sheet Name
96
108
97
- Option 1: You can set the Excel sheet name by setting the property.
109
+ Option 1: You can set the Excel sheet name by setting the property.
98
110
99
111
``` html
100
- <livewire:export-button :table-id =" $dataTable->getTableId()" sheet-name =" Monthly Report" />
112
+
113
+ <livewire:export-button :table-id =" $dataTable->getTableId()" sheet-name =" Monthly Report" />
101
114
```
102
115
103
116
Option 2: You can also set the Excel sheet name by overwriting the method.
@@ -185,16 +198,19 @@ Column::make('id')->exportFormat(NumberFormat::FORMAT_TEXT),
185
198
Option to automatically download the exported file.
186
199
187
200
``` html
201
+
188
202
<livewire:export-button :table-id =" $dataTable->getTableId()" filename =" my-table.xlsx" auto-download =" true" />
189
203
```
190
204
191
205
## Contributing
192
206
193
- Please see [ CONTRIBUTING] ( https://github.com/yajra/laravel-datatables-export/blob/master/.github/CONTRIBUTING.md ) for details.
207
+ Please see [ CONTRIBUTING] ( https://github.com/yajra/laravel-datatables-export/blob/master/.github/CONTRIBUTING.md ) for
208
+ details.
194
209
195
210
## Security
196
211
197
- If you discover any security related issues, please email
[ [email protected] ] ( mailto:[email protected] ) instead of using the issue tracker.
212
+ If you discover any security related issues, please email
[ [email protected] ] ( mailto:[email protected] ) instead of
213
+ using the issue tracker.
198
214
199
215
## Credits
200
216
@@ -204,4 +220,5 @@ If you discover any security related issues, please email [
[email protected] ](
204
220
205
221
## License
206
222
207
- The MIT License (MIT). Please see [ License File] ( https://github.com/yajra/laravel-datatables-export/blob/master/LICENSE.md ) for more information.
223
+ The MIT License (MIT). Please
224
+ see [ License File] ( https://github.com/yajra/laravel-datatables-export/blob/master/LICENSE.md ) for more information.
0 commit comments