Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Datatables Buttons

Laravel Datatables Buttons Laravel Package

yajra/laravel-datatables-buttons

Laravel DataTables Buttons is a plugin for Laravel DataTables that handles server-side exporting of tables to CSV, Excel, and PDF, plus printing. Compatible with Laravel 12.x and PHP 8.3+, it installs via Composer and includes an optional service provider and publishable config/assets.

View on GitHub
Deep Wiki
Context7

Laravel DataTables Buttons is a plugin for Laravel DataTables that adds server-side support for the jQuery DataTables Buttons extension, letting you export tables as CSV, Excel, PDF, or print directly from your DataTables UI. It integrates seamlessly with the Laravel DataTables HTML builder, so exporting actions are configured alongside your existing table definitions.

Built for PHP 8.3+ and Laravel 12.x, the package ships with a service provider and publishable configuration/assets, making setup a single composer require away.

  • Server-side export handling for CSV, Excel, PDF, and printing
  • Seamless integration with the Laravel DataTables HTML builder
  • Publishable configuration and assets via Artisan
  • Versioned releases matching Laravel 9.x through 13.x
  • Fully documented in the official Laravel DataTables docs
Frequently asked questions about Laravel Datatables Buttons
How do I install yajra/laravel-datatables-buttons in Laravel?
Run composer require yajra/laravel-datatables-buttons:^13. The ButtonsServiceProvider is auto-discovered on modern Laravel, but you can register Yajra\DataTables\ButtonsServiceProvider manually if needed. Optionally publish the config and JS/CSS assets with php artisan vendor:publish --tag=datatables-buttons --force, then wire the Buttons extension into your jQuery DataTables front end.
Does this package work without yajra/laravel-datatables?
No. Laravel DataTables Buttons is a plugin for yajra/laravel-datatables and depends on that package's server-side query pipeline and response format. If your tables use Livewire, Inertia/Vue grids, or hand-rolled tables, you would need a separate export implementation instead.
Which Laravel and PHP versions does this package support?
The PHP floor is 8.3 and package majors track Laravel majors, so the 13.x line pairs with Laravel 13 and the 12.x line with Laravel 12, while older versions map back to 4.x through 11.x for earlier Laravel releases. Because of the 8.3 requirement, legacy applications are effectively excluded. Pin the package major to your Laravel major rather than floating constraints.
Why is my PDF export failing or returning a broken download?
PDF output depends on a third-party rendering engine such as dompdf, Snappy, or wkhtmltopdf, none of which are bundled with this package. That engine and any native binaries must be installed in every container image and in the deploy pipeline, which is usually why exports work locally but fail in production. CSV, Excel, and print do not have this extra dependency.
Are exports generated on the client or on the server?
Exports run on the server and reuse the DataTable's existing query, so downloads honor the active filters and sort order without duplicating query logic. Client-side export would only ever capture the current page of rows. This server-side design is the main reason to pair the package with yajra/laravel-datatables in the first place.
Is jQuery DataTables 2.x supported?
The documented requirements call for jQuery DataTables v1.10.x plus the DataTables Buttons extension, while upstream DataTables is on 2.x. Confirm whether that pin is a hard constraint or simply untested before planning any front-end modernization. If you move to 2.x or a component-library grid, expect to build a parallel export path.
Which Excel library does the package use for spreadsheet exports?
Version 13.1.0 dropped fast-excel in favor of OpenSpout, and earlier releases also added exportRender(), exportFormat, and enum-based export support. Because the export engine has changed across minors, custom code at the cell-formatting or styling layer carries some rework risk on upgrade. Keep such customizations isolated and covered by tests.
Can it export large tables without timing out or exhausting memory?
Exports are synchronous downloads, so very large result sets can hit PHP memory limits or request timeouts. During a pilot, measure export duration, peak memory, and row counts on a low-traffic admin table to find your practical ceiling. Above that threshold you will want queued or emailed exports rather than a button that streams directly to the browser.
Do export buttons respect permissions and row-level scopes?
Only if the underlying DataTable query enforces them. The button is just UI, so hiding it is not access control; authorization and row-level scopes must be applied in the query that the export reuses. Verify this explicitly for each table before exposing downloads to non-admin users.
How often do I need to upgrade this package?
Expect a coordinated dependency bump with every Laravel major, since package majors track Laravel majors and this is never just a patch. Treat it as a recurring annual maintenance cost and assign an owner for the next Laravel bump. Adoption is relatively thin, so also rely on the CI and static-analysis workflows and the parent laravel-datatables family for confidence.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections