You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Fast-Excel](https://github.com/rap2hpoutre/fast-excel) is recommended when exporting bulk records.
4
+
5
+
## Usage
6
+
7
+
1. Install `fast-excel` using `composer require rap2hpoutre/fast-excel`.
8
+
2. Create a dataTable class `php artisan datatables:make Users`
9
+
3. Adjust `UsersDataTable` as needed.
10
+
4. Set property `$fastExcel = true`.
11
+
12
+
```php
13
+
class UsersDataTable extends DataTable
14
+
{
15
+
protected $fastExcel = true;
16
+
17
+
...
18
+
}
19
+
```
20
+
21
+
5. DataTables will now export csv & excel using `fast-excel` package.
22
+
23
+
24
+
## Faster export by disabling the fast-excel callback
25
+
26
+
1. Just set property `$fastExcelCallback = false`. This is enabled by default for a better formatted output of exported file.
27
+
28
+
```php
29
+
class UsersDataTable extends DataTable
30
+
{
31
+
protected $fastExcel = true;
32
+
protected $fastExcelCallback = false;
33
+
34
+
```
35
+
36
+
2. Exported file will now be based on how your query was structured. No header formatting and all selected columns in sql will be included in the output.
0 commit comments