A Laravel wrapper around PhpSpreadsheet for exporting collections, queries and Blade views to Excel or CSV, and importing spreadsheets into Eloquent models.
rap2hpoutre/fast-excel
Laravel package for fast, memory-efficient reading and writing of xlsx, ods and csv files, built on OpenSpout.
Open-source alternative to:Laravel Excel
- Stars
- 2,393
- Forks
- 271
- Open issues
- 3
- Last commit
- 7 days ago
What is it?
FastExcel is a Laravel package for importing and exporting spreadsheet data. It wraps the OpenSpout library with a small, Laravel-friendly API so you can export Eloquent models, query results, collections or generators to xlsx, ods and csv files, and import those formats back into collections or through a per-row callback.
The package focuses on memory use. Passing a lazy source such as a cursor, a generator or importLazy() streams rows one at a time, so peak memory stays roughly flat as the row count grows. Materialized collections are loaded fully into memory first, which can exceed PHP's memory_limit on large datasets. The project positions itself as a lighter alternative to Laravel Excel with fewer features, intended for simpler import and export tasks.
Beyond basic I/O, it supports multiple sheets, header and row styling, column widths, string-typed cells to preserve leading zeros, skipping rows during export, and escaping formulas to guard against formula injection.
Key features
- 01Export Eloquent models, query results, collections or generators to xlsx, ods and csv.
- 02Import spreadsheets into collections or process each row with a callback.
- 03Stream large exports and imports with cursors, generators and importLazy() to keep memory low.
- 04Read and write multiple sheets, selecting sheets by index or name.
- 05Apply header and row styles, and set explicit column widths for xlsx and ods.
- 06Force values to text cells or escape formulas to prevent formula injection.
Use cases
- Exporting large user or order tables from a Laravel app to Excel without exhausting memory.
- Importing customer or product spreadsheets into database tables with a per-row callback.
- Generating CSV or Excel reports from Laravel queries for download in a controller.
- Replacing a heavier Laravel Excel setup for simple import and export tasks.
Quick start
- 1
Install the package via Composer
composer require rap2hpoutre/fast-excel - 2
Export a collection or model to an xlsx file
Things to know
- Requires PHP and Laravel, so it does not work as a standalone library outside that ecosystem.
In collections
Topics
FAQ
- What is fast-excel?
- Laravel package for fast, memory-efficient reading and writing of xlsx, ods and csv files, built on OpenSpout. FastExcel is a Laravel package for importing and exporting spreadsheet data. It wraps the OpenSpout library with a small, Laravel-friendly API so you can export Eloquent models, query results, collections or generators to xlsx, ods and csv files, and import those formats back into collections or through a per-row callback.
- Is fast-excel free to use? What license does it have?
- fast-excel is open source under the MIT license. Check the license terms before using it in commercial products.
- Is fast-excel still maintained?
- Actively maintained. The last commit to fast-excel was on Oct 29, 2026.
- What can I use fast-excel for?
- Exporting large user or order tables from a Laravel app to Excel without exhausting memory. Importing customer or product spreadsheets into database tables with a per-row callback. Generating CSV or Excel reports from Laravel queries for download in a controller. Replacing a heavier Laravel Excel setup for simple import and export tasks.
- How do I install fast-excel?
- Install the package via Composer: composer require rap2hpoutre/fast-excel Export a collection or model to an xlsx file
- Where can I get fast-excel?
- The source code and installation instructions are on GitHub: https://github.com/rap2hpoutre/fast-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.
Pure Go library for reading and writing Excel XLSX, XLSM, XLTX, XLTM and XLAM spreadsheet files without Microsoft Office.
A work-in-progress spreadsheet engine written in Rust, with xlsx read/write and bindings for Python and JavaScript (wasm).
A WebAssembly and JavaScript port of the Go Excelize library for reading and writing Excel XLSX, XLSM, XLTX and related spreadsheet files in Node.js and browsers.
Python library for reading and writing Excel spreadsheet files (XLSX, XLSM, XLTX, XLTM, XLAM), ported from the Go Excelize library.