File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,40 @@ class UsersDataTable extends DataTable
105
105
...
106
106
```
107
107
108
+ <a name =" post-export " ></a >
109
+ ## Export as Excel, CSV, and PDF using POST method
110
+
111
+ To enable exporting to excel, csv, and pdf using POST method set the following on the buttons array.
112
+ This is recommended if you have a long query and if you are using IE browsers.
113
+
114
+ ``` php
115
+ namespace App\DataTables;
116
+
117
+ use App\User;
118
+ use Yajra\DataTables\Services\DataTable;
119
+
120
+ class UsersDataTable extends DataTable
121
+ {
122
+ //...some default stubs deleted for simplicity.
123
+
124
+ public function html()
125
+ {
126
+ return $this->builder()
127
+ ->columns($this->getColumns())
128
+ ->parameters([
129
+ 'buttons' => ['postExcel', 'postCsv', 'postPdf'],
130
+ ]);
131
+ }
132
+ ...
133
+ ```
134
+
135
+ And also add this code to your routes.php file.
136
+ ``` php
137
+ Route::resource('sample', 'SampleController@index');
138
+ Route::post('sample/export', 'SampleController@index');
139
+ ...
140
+ ```
141
+
108
142
<a name =" print " ></a >
109
143
## Printable Version
110
144
You can’t perform that action at this time.
0 commit comments