@@ -48,13 +48,13 @@ php artisan migrate
4848
49491 . Add the export-button livewire component on your view file that uses dataTable class.
5050
51- ``` phpt
51+ ``` php
5252<livewire:export-button :table-id =" $dataTable->getTableId()" />
5353```
5454
55552 . On your ` DataTable ` class, use ` WithExportQueue `
5656
57- ``` phpt
57+ ``` php
5858use Yajra\DataTables\WithExportQueue;
5959
6060class PermissionsDataTable extends DataTable
@@ -71,15 +71,15 @@ class PermissionsDataTable extends DataTable
7171
7272On ` app\Console\Kernel.php ` , register the purge command
7373
74- ``` phpt
74+ ``` php
7575$schedule->command('datatables:purge-export')->weekly();
7676```
7777
7878## Export Filename
7979
8080You can set the export filename by setting the property.
8181
82- ``` phpt
82+ ``` php
8383<livewire:export-button :table-id =" $dataTable->getTableId()" filename =" my-table.xlsx" />
8484<livewire:export-button :table-id =" $dataTable->getTableId()" filename =" my-table.csv" />
8585
@@ -90,7 +90,7 @@ You can set the export filename by setting the property.
9090
9191You can set the export type by setting the property to ` csv ` or ` xlsx ` . Default value is ` xlsx ` .
9292
93- ``` phpt
93+ ``` php
9494<livewire:export-button :table-id =" $dataTable->getTableId()" type =" xlsx" />
9595<livewire:export-button :table-id =" $dataTable->getTableId()" type =" csv" />
9696```
@@ -99,7 +99,7 @@ You can set the export type by setting the property to `csv` or `xlsx`. Default
9999
100100You can format the column by setting it via Column definition on you DataTable service class.
101101
102- ``` phpt
102+ ``` php
103103Column::make('mobile')->exportFormat('00000000000'),
104104```
105105
@@ -109,7 +109,7 @@ The format above will treat mobile numbers as text with leading zeroes.
109109
110110The package will auto-detect numeric fields and can be used with custom formats.
111111
112- ``` phpt
112+ ``` php
113113Column::make('total')->exportFormat('0.00'),
114114Column::make('count')->exportFormat('#,##0'),
115115Column::make('average')->exportFormat('#,##0.00),
@@ -119,7 +119,7 @@ Column::make('average')->exportFormat('#,##0.00),
119119
120120The package will auto-detect date fields when used with a valid format or is a DateTime instance.
121121
122- ``` phpt
122+ ``` php
123123Column::make('report_date')->exportFormat('mm/dd/yyyy'),
124124Column::make('created_at'),
125125Column::make('updated_at')->exportFormat(NumberFormat::FORMAT_DATE_DATETIME),
@@ -129,7 +129,7 @@ Column::make('updated_at')->exportFormat(NumberFormat::FORMAT_DATE_DATETIME),
129129
130130Valid date formats can be adjusted on ` datatables-export.php ` config file.
131131
132- ``` phpt
132+ ``` php
133133 'date_formats' => [
134134 'mm/dd/yyyy',
135135 NumberFormat::FORMAT_DATE_DATETIME,
0 commit comments