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

Fast Excel Laravel Package

rap2hpoutre/fast-excel

Fast Excel import/export for Laravel, powered by Spout. Export Eloquent models, queries, or collections to xlsx, ods, or csv with a simple API, customize columns via callbacks, and handle large files efficiently. Benchmark-tested for speed.

View on GitHub
Deep Wiki
Context7
v5.17.0

headerRow()

startRow() alone used to double as the header row too, so reading a file starting anywhere but row 1 lost the real headers — the first data row got used as the header names instead. headerRow() decouples the two.

$rows = (new FastExcel())->headerRow(1)->startRow(4)->import('file.xlsx');

This is also what makes chunked imports work cleanly: every chunk can read the same header row while sliding its own startRow()/limitRows() window over the data. startRow() on its own keeps its historical meaning, so nothing breaks for existing callers.

Fixes #349, reported by @MaarekVarres.

escapeFormulas()

Cell values starting with =, +, - or @ are treated as formulas by Excel and other spreadsheet software, which can silently execute unintended content when a file is opened. escapeFormulas() writes those values as plain text instead.

(new FastExcel($rows))->escapeFormulas()->export('file.xlsx');

Fixes #356, reported by @LauKL1991. Thanks also to @ariprw and @gmutinel, whose '-prefix workarounds on the issue shaped the fix.


Thanks to @dannyyol for reviewing both of these.

Full changelog: https://github.com/rap2hpoutre/fast-excel/compare/v5.16.0...v5.17.0

v5.15.0

rightToLeft()

XLSX exports can now open as proper right-to-left sheets. Column order, scroll direction and the grid all run right to left, which is what Arabic business documents expect.

(new FastExcel($report))->rightToLeft()->export('report.xlsx');

Multi-sheet exports are covered too: every sheet in a SheetCollection gets the setting, not just the first. Pass rightToLeft(false) to turn it back off. CSV and ODS ignore it, since neither format has an equivalent.

Thanks to @moemadeldin for this one. He opened #420 explaining why configureWriterUsing() couldn't reach the setting (the sheet doesn't exist yet when that hook runs), then sent #421 with the fix and tests covering both the single-sheet and multi-sheet paths. The issue write-up did half the work.

withSheetContext()

importSheets() can now pass the sheet name to your callback, so the same field names can be treated differently depending on which sheet they came from.

$sheets = (new FastExcel)
    ->withSheetContext()
    ->importSheets('file.xlsx', function ($sheetName, $row) {
        return $row + ['_sheet' => $sheetName];
    });

Requested in #369 by @StarkOne, whose earlier patch shaped the final version.


Full changelog: https://github.com/rap2hpoutre/fast-excel/compare/v5.14.0...v5.15.0

v5.14.0

What's Changed

Full Changelog: https://github.com/rap2hpoutre/fast-excel/compare/v5.13.0...v5.14.0

v5.13.0

What's Changed

Full Changelog: https://github.com/rap2hpoutre/fast-excel/compare/v5.12.0...v5.13.0

v5.12.0

What's Changed

Full Changelog: https://github.com/rap2hpoutre/fast-excel/compare/v5.11.0...v5.12.0

v5.11.0

What's Changed

Full Changelog: https://github.com/rap2hpoutre/fast-excel/compare/v5.10.0...v5.11.0

v5.10.0

What's Changed

New Contributors

Full Changelog: https://github.com/rap2hpoutre/fast-excel/compare/v5.9.0...v5.10.0

v5.9.0

What's Changed

Full Changelog: https://github.com/rap2hpoutre/fast-excel/compare/v5.8.0...v5.9.0

v5.8.0
v5.7.0
v5.6.0
v5.5.0
v5.4.0
v5.3.0
v5.2.0
v5.1.1
v5.1.0
v5.0.0
v4.1.0
v4.0.0
v3.2.0
v3.1.0

What's Changed

New Contributors

Full Changelog: https://github.com/rap2hpoutre/fast-excel/compare/v3.0.2...v3.1.0

v3.0.2
v3.0.1
v3.0.0
  • add support for PHP 8
  • update PHPUnit to 6.4 to 9.5
  • update Spout from 2 to 3
  • (breaking change) drop support for PHP 7.1
  • (breaking change) remove setEndOfLineCharacter support for CSV
v2.5.0
v2.4.0
v2.3.0
v2.2.0
v2.1.0
v2.0.1
v2.0.0
v1.7.0
v1.6
v1.6.1
1.6.0
v1.5.0
v1.4.0
v1.3.2
v1.3.1
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.
hotmeteor/eco-env
mvaliolahi/hydrate
wearede/tbcpay-php
parsnick/steak
thibaud-dauce/mattermost-php
multilinguals/apollo-client
antaresbr/collection
kr0lik/phpstan-rules
loco/loco
starfederation/datastar-php
yupmin/modern-phystrix
stephenjude/extended-artisan-commands
lumphp/laravel-macroable
lumphp/laravel-collections
lumphp/laravel-contracts
sermepa/sermepa
arkecosystem/fortify
arkecosystem/ui
owowagency/laravel-resources
gtjamesa/php-standards