Download the PHP package yajra/laravel-datatables-export without Composer
On this page you can find all versions of the php package yajra/laravel-datatables-export. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-datatables-export
Laravel DataTables Export Plugin
This package is a plugin of Laravel DataTables for handling server-side exporting using Queue, OpenSpout and Livewire.
Requirements
Documentations
Laravel Version Compatibility
Laravel | Package |
---|---|
8.x | 0.x |
9.x | 1.x |
10.x | 10.x |
11.x | 11.x |
Quick Installation
composer require yajra/laravel-datatables-export:^11.0
The package also requires batch job:
Service Provider (Optional since Laravel 5.5+)
Yajra\DataTables\ExportServiceProvider::class
Configuration and Assets (Optional)
$ php artisan vendor:publish --tag=datatables-export --force
Usage
-
Add the export-button livewire component on your view file that uses dataTable class.
-
On your
DataTable
class, useWithExportQueue
- Run your queue worker. Ex:
php artisan queue:work
Purging exported files
On app\Console\Kernel.php
, register the purge command
Export Filename
You can set the export filename by setting the property.
Export Button Name
You can set the export button name by setting the buttonName
property.
Export Type
You can set the export type by setting the property to csv
or xlsx
. Default value is xlsx
.
Set Excel Sheet Name
Option 1: You can set the Excel sheet name by setting the property.
Option 2: You can also set the Excel sheet name by overwriting the method.
Formatting Columns
You can format the column by setting it via Column definition on you DataTable service class.
The format above will treat mobile numbers as text with leading zeroes.
Numeric Fields Formatting
The package will auto-detect numeric fields and can be used with custom formats.
Date Fields Formatting
The package will auto-detect date fields when used with a valid format or is a DateTime instance.
Valid Date Formats
Valid date formats can be adjusted on datatables-export.php
config file.
Force Numeric Field As Text Format
Option to force auto-detected numeric value as text format.
Auto Download
Option to automatically download the exported file.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-datatables-export with dependencies
ext-json Version *
livewire/livewire Version ^2.11.2|^3.5.6
openspout/openspout Version ^4.24.5
phpoffice/phpspreadsheet Version 2.3.0
yajra/laravel-datatables-buttons Version ^11.0