Laravel package for fast, memory-efficient reading and writing of xlsx, ods and csv files, built on OpenSpout.
SpartnerNL/Laravel-Excel
A Laravel wrapper around PhpSpreadsheet for exporting collections, queries and Blade views to Excel or CSV, and importing spreadsheets into Eloquent models.
- Stars
- 12,704
- Forks
- 1,988
- Open issues
- 0
- Last commit
- 3 days ago
What is it?
Laravel Excel is a PHP package that wraps PhpSpreadsheet with Laravel-friendly classes for spreadsheet exports and imports. Developers define an export or import class and let the package handle the file generation or parsing, instead of working with the lower-level PhpSpreadsheet API directly.
On the export side, it can turn Laravel collections into Excel or CSV files, export Eloquent queries with automatic chunking, and render Blade views containing HTML tables as spreadsheets. Large exports can be queued so they run in the background.
On the import side, it reads workbooks and worksheets into Eloquent models using chunk reading and batch inserts, and large files can be processed as queued chunks. The package is licensed under MIT, with the author requesting a postcard as Postcardware.
Key features
- 01Export Laravel collections to Excel or CSV files.
- 02Export Eloquent queries with automatic chunking.
- 03Queue exports and imports to run in the background.
- 04Import worksheets into Eloquent models with chunk reading and batch inserts.
- 05Export Blade views containing HTML tables as spreadsheets.
Use cases
- Adding a downloadable Excel or CSV report to a Laravel admin panel.
- Importing customer or product spreadsheets into database tables.
- Exporting large database query results without exhausting memory.
- Generating formatted spreadsheets from Blade templates.
Things to know
- Version 3.1 gets only CVE fixes, and version 4.0 requires PHP 8.3 and Laravel 12 or newer.
- The README asks production users to send a postcard, though the MIT license does not require it.
Topics
FAQ
- What is Laravel-Excel?
- A Laravel wrapper around PhpSpreadsheet for exporting collections, queries and Blade views to Excel or CSV, and importing spreadsheets into Eloquent models. Laravel Excel is a PHP package that wraps PhpSpreadsheet with Laravel-friendly classes for spreadsheet exports and imports. Developers define an export or import class and let the package handle the file generation or parsing, instead of working with the lower-level PhpSpreadsheet API directly.
- Is Laravel-Excel free to use? What license does it have?
- Laravel-Excel is open source under the MIT license. Check the license terms before using it in commercial products.
- Is Laravel-Excel still maintained?
- Actively maintained. The last commit to Laravel-Excel was on Nov 3, 2026.
- What can I use Laravel-Excel for?
- Adding a downloadable Excel or CSV report to a Laravel admin panel. Importing customer or product spreadsheets into database tables. Exporting large database query results without exhausting memory. Generating formatted spreadsheets from Blade templates.
- Where can I get Laravel-Excel?
- The source code and installation instructions are on GitHub: https://github.com/SpartnerNL/Laravel-Excel
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Java library for reading and writing Excel and CSV spreadsheets with low memory use, suited to large files.
Laravel package for i18n URL localization: locale-prefixed routes, browser language detection, translatable route slugs and language selector helpers.
A PHP SDK for building Telegram bots on the Telegram Bot API, with built-in Laravel support.
A real-time chat package for Laravel that adds direct messages, groups, attachments, and a bundled messenger UI to a Laravel app.
A Laravel Scout driver that adds full-text search to Eloquent models using the TNTSearch PHP engine, with no external search server.