PHPackages                             yajra/laravel-datatables-export - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. yajra/laravel-datatables-export

ActiveLibrary[Queues &amp; Workers](/categories/queues)

yajra/laravel-datatables-export
===============================

Laravel DataTables Queued Export Plugin.

v13.2.1(1w ago)362.2M↓30.3%25[2 issues](https://github.com/yajra/laravel-datatables-export/issues)2MITPHPPHP ^8.3CI passing

Since Oct 4Pushed 1w ago4 watchersCompare

[ Source](https://github.com/yajra/laravel-datatables-export)[ Packagist](https://packagist.org/packages/yajra/laravel-datatables-export)[ GitHub Sponsors](https://github.com/sponsors/yajra)[ RSS](/packages/yajra-laravel-datatables-export/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (10)Dependencies (50)Versions (61)Used By (2)

Laravel DataTables Export Plugin
================================

[](#laravel-datatables-export-plugin)

[![Laravel 13.x](https://camo.githubusercontent.com/7d26243fe9d5aee0d191aca5fd06f0318fe6a4f63dbc4b52b6f64ef508e6af5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31332e782d6f72616e67652e737667)](http://laravel.com)[![Latest Stable Version](https://camo.githubusercontent.com/69debef75f9da48735cff72ec2d6bd6b50149e332c9e56a5ff985370c7cf37a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79616a72612f6c61726176656c2d646174617461626c65732d6578706f72742e737667)](https://packagist.org/packages/yajra/laravel-datatables-export)[![Continuous Integration](https://github.com/yajra/laravel-datatables-export/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/yajra/laravel-datatables-export/actions/workflows/continuous-integration.yml)[![Static Analysis](https://github.com/yajra/laravel-datatables-export/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/yajra/laravel-datatables-export/actions/workflows/static-analysis.yml)[![Total Downloads](https://camo.githubusercontent.com/e1ab48f9cb95c55d20bde43112dd8682e266b7ad9e8f122cebaaa034b2ca31b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79616a72612f6c61726176656c2d646174617461626c65732d6578706f72742e737667)](https://packagist.org/packages/yajra/laravel-datatables-export)[![License](https://camo.githubusercontent.com/850eae1099d2b05f53383473d7cd51f9bc1ab09b7d0d9e5122f1dd930efdcc6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e737667)](https://packagist.org/packages/yajra/laravel-datatables-export)

This package is a plugin of [Laravel DataTables](https://github.com/yajra/laravel-datatables) for handling server-side exporting using Queue, OpenSpout and Livewire.

Requirements
------------

[](#requirements)

- [PHP &gt;=8.3](http://php.net/) (OpenSpout 5.x, if installed, requires PHP 8.4+)
- [Laravel 13](https://github.com/laravel/framework)
- [Laravel Livewire](https://laravel-livewire.com/)
- [OpenSpout](https://github.com/openspout/openspout/)
- [Laravel DataTables 13.x](https://github.com/yajra/laravel-datatables)
- [jQuery DataTables 2.x](http://datatables.net/)

Documentations
--------------

[](#documentations)

- [Laravel DataTables Documentation](http://yajrabox.com/docs/laravel-datatables)

Laravel Version Compatibility
-----------------------------

[](#laravel-version-compatibility)

LaravelPackage8.x0.x9.x1.x10.x10.x11.x11.x12.x12.x13.x13.xQuick Installation
------------------

[](#quick-installation)

```
composer require yajra/laravel-datatables-export:"^13.0"

```

The package also requires batch job:

```
php artisan queue:batches-table
php artisan migrate
```

### Configuration and Assets (Optional)

[](#configuration-and-assets-optional)

```
php artisan vendor:publish --tag=datatables-export --force

```

Usage
-----

[](#usage)

1. Add the export-button livewire component on your view file that uses dataTable class.

```

```

2. On your `DataTable` class, use `WithExportQueue`

```
use Yajra\DataTables\WithExportQueue;

class PermissionsDataTable extends DataTable
{
    use WithExportQueue;

    ...
}
```

3. Run your queue worker. Ex: `php artisan queue:work`

Purging exported files
----------------------

[](#purging-exported-files)

On `app\Console\Kernel.php`, register the purge command

```
$schedule->command('datatables:purge-export')->weekly();
```

Export Filename
---------------

[](#export-filename)

You can set the export filename by setting the property.

```

```

Export Button Name
------------------

[](#export-button-name)

You can set the export button name by setting the `buttonName` property.

```

```

Export Type
-----------

[](#export-type)

You can set the export type by setting the property to `csv` or `xlsx`. Default value is `xlsx`.

```

```

Set Excel Sheet Name
--------------------

[](#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.

```
protected function sheetName() : string
{
    return "Yearly Report";
}
```

Formatting Columns
------------------

[](#formatting-columns)

You can format the column by setting it via Column definition on you DataTable service class.

```
Column::make('mobile')->exportFormat('00000000000'),
```

The format above will treat mobile numbers as text with leading zeroes.

Numeric Fields Formatting
-------------------------

[](#numeric-fields-formatting)

The package will auto-detect numeric fields and can be used with custom formats.

```
Column::make('total')->exportFormat('0.00'),
Column::make('count')->exportFormat('#,##0'),
Column::make('average')->exportFormat('#,##0.00'),
```

Date Fields Formatting
----------------------

[](#date-fields-formatting)

The package will auto-detect date fields when used with a valid format or is a DateTime instance.

```
Column::make('report_date')->exportFormat('mm/dd/yyyy'),
Column::make('created_at'),
Column::make('updated_at')->exportFormat(NumberFormat::FORMAT_DATE_DATETIME),
```

Valid Date Formats
------------------

[](#valid-date-formats)

Valid date formats can be adjusted on `datatables-export.php` config file.

```
    'date_formats' => [
        'mm/dd/yyyy',
        NumberFormat::FORMAT_DATE_DATETIME,
        NumberFormat::FORMAT_DATE_YYYYMMDD,
        NumberFormat::FORMAT_DATE_XLSX22,
        NumberFormat::FORMAT_DATE_DDMMYYYY,
        NumberFormat::FORMAT_DATE_DMMINUS,
        NumberFormat::FORMAT_DATE_DMYMINUS,
        NumberFormat::FORMAT_DATE_DMYSLASH,
        NumberFormat::FORMAT_DATE_MYMINUS,
        NumberFormat::FORMAT_DATE_TIME1,
        NumberFormat::FORMAT_DATE_TIME2,
        NumberFormat::FORMAT_DATE_TIME3,
        NumberFormat::FORMAT_DATE_TIME4,
        NumberFormat::FORMAT_DATE_TIME5,
        NumberFormat::FORMAT_DATE_TIME6,
        NumberFormat::FORMAT_DATE_TIME7,
        NumberFormat::FORMAT_DATE_XLSX14,
        NumberFormat::FORMAT_DATE_XLSX15,
        NumberFormat::FORMAT_DATE_XLSX16,
        NumberFormat::FORMAT_DATE_XLSX17,
        NumberFormat::FORMAT_DATE_YYYYMMDD2,
        NumberFormat::FORMAT_DATE_YYYYMMDDSLASH,
    ]
```

Force Numeric Field As Text Format
----------------------------------

[](#force-numeric-field-as-text-format)

Option to force auto-detected numeric value as text format.

```
Column::make('id')->exportFormat('@'),
Column::make('id')->exportFormat(NumberFormat::FORMAT_GENERAL),
Column::make('id')->exportFormat(NumberFormat::FORMAT_TEXT),
```

Auto Download
-------------

[](#auto-download)

Option to automatically download the exported file.

```

```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/yajra/laravel-datatables-export/blob/master/.github/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Arjay Angeles](https://github.com/yajra)
- [All Contributors](https://github.com/yajra/laravel-datatables-export/graphs/contributors)
- [Laravel Daily](https://github.com/LaravelDaily/Laravel-Excel-Export-Import-Large-Files)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/yajra/laravel-datatables-export/blob/master/LICENSE.md) for more information.

###  Health Score

70

—

ExcellentBetter than 100% of packages

Maintenance97

Actively maintained with recent releases

Popularity55

Moderate usage in the ecosystem

Community32

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 75.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~30 days

Recently: every ~23 days

Total

58

Last Release

10d ago

Major Versions

v0.14.1 → v10.1.12023-11-14

10.x-dev → v11.0.02024-03-14

v11.4.2 → v12.0.02025-02-26

11.x-dev → v12.0.22025-06-11

v12.3.1 → v13.0.02026-03-25

PHP version history (4 changes)v0.1.0PHP &gt;=7.4|8.\*

v10.0.0PHP ^8.1

v11.0.0PHP ^8.2

v13.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c245d1effe6022f9f09b2e8b9cce26743de03a64d612cea4ce9885560d7c0b2?d=identicon)[yajra](/maintainers/yajra)

---

Top Contributors

[![yajra](https://avatars.githubusercontent.com/u/2687997?v=4)](https://github.com/yajra "yajra (207 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (8 commits)")[![Seb33300](https://avatars.githubusercontent.com/u/915273?v=4)](https://github.com/Seb33300 "Seb33300 (7 commits)")[![hpacleb](https://avatars.githubusercontent.com/u/24486552?v=4)](https://github.com/hpacleb "hpacleb (7 commits)")[![jeanne007](https://avatars.githubusercontent.com/u/33174386?v=4)](https://github.com/jeanne007 "jeanne007 (7 commits)")[![nicacode](https://avatars.githubusercontent.com/u/87890765?v=4)](https://github.com/nicacode "nicacode (5 commits)")[![uchajk](https://avatars.githubusercontent.com/u/32559183?v=4)](https://github.com/uchajk "uchajk (4 commits)")[![throwExceptions](https://avatars.githubusercontent.com/u/162918475?v=4)](https://github.com/throwExceptions "throwExceptions (3 commits)")[![jidago](https://avatars.githubusercontent.com/u/56063120?v=4)](https://github.com/jidago "jidago (3 commits)")[![jaydons](https://avatars.githubusercontent.com/u/44308248?v=4)](https://github.com/jaydons "jaydons (3 commits)")[![ejgandelaberon](https://avatars.githubusercontent.com/u/23096901?v=4)](https://github.com/ejgandelaberon "ejgandelaberon (3 commits)")[![alexpm51](https://avatars.githubusercontent.com/u/36556948?v=4)](https://github.com/alexpm51 "alexpm51 (2 commits)")[![DarmawanEfendi](https://avatars.githubusercontent.com/u/7403238?v=4)](https://github.com/DarmawanEfendi "DarmawanEfendi (2 commits)")[![RobXYZ](https://avatars.githubusercontent.com/u/1113957?v=4)](https://github.com/RobXYZ "RobXYZ (2 commits)")[![mariopro](https://avatars.githubusercontent.com/u/2560046?v=4)](https://github.com/mariopro "mariopro (1 commits)")[![jsarmientoOB](https://avatars.githubusercontent.com/u/197703267?v=4)](https://github.com/jsarmientoOB "jsarmientoOB (1 commits)")[![patricktorres27](https://avatars.githubusercontent.com/u/31270504?v=4)](https://github.com/patricktorres27 "patricktorres27 (1 commits)")[![colornokia](https://avatars.githubusercontent.com/u/47701259?v=4)](https://github.com/colornokia "colornokia (1 commits)")[![jiwom](https://avatars.githubusercontent.com/u/22045242?v=4)](https://github.com/jiwom "jiwom (1 commits)")[![jidagob](https://avatars.githubusercontent.com/u/88225209?v=4)](https://github.com/jidagob "jidagob (1 commits)")

---

Tags

datatablesexport-excelhacktoberfestlaravellaravel-packagephplaravelexportexcelqueuedatatableslivewire

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/yajra-laravel-datatables-export/health.svg)

```
[![Health](https://phpackages.com/badges/yajra-laravel-datatables-export/health.svg)](https://phpackages.com/packages/yajra-laravel-datatables-export)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.9k157.3M899](/packages/maatwebsite-excel)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[zappzerapp/laravel-ingest

A robust, configuration-driven ETL and data import framework for Laravel. Handles CSV/Excel streaming, queues, validation, and relationships.

1032.4k](/packages/zappzerapp-laravel-ingest)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
