- Add the export-button livewire component on your view file that uses dataTable class.
<livewire:export-button :table-id="$dataTable->getTableId()" />
- On your
DataTable
class, useWithExportQueue
use Yajra\DataTables\WithExportQueue;
class PermissionsDataTable extends DataTable
{
use WithExportQueue;
...
}
- Run your queue worker. Ex:
php artisan queue:work