Weave Code
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. Quickly export Eloquent models or collections to XLSX/ODS/CSV, customize column mapping, and download from controllers. Import files to collections, configure CSV options, or persist rows directly to the database.

View on GitHub
Deep Wiki
Context7

rap2hpoutre/fast-excel is a lightweight Laravel package for fast Excel/CSV import & export, powered by Spout. It focuses on simple APIs and performance, making it easy to move data between Eloquent/Collections and spreadsheet files.

Use it to export data to XLSX/ODS/CSV, download files from controllers, or import spreadsheets into a Collection (with optional row mapping for DB inserts).

  • Export Eloquent models or Collections to xlsx, ods, or csv
  • Customize output with a callback to map columns/values
  • Import files into a Collection with optional per-row handler
  • Configure CSV delimiter/enclosure/encoding
  • Controller-friendly download() support
Frequently asked questions about Fast Excel
How do I export Eloquent models to Excel in Laravel using FastExcel?
Use the `FastExcel` class with your Eloquent collection. For example, `(new FastExcel(User::all()))->export('users.xlsx')` generates an XLSX file. You can also customize columns with a callback for dynamic formatting.
Does FastExcel support CSV imports with custom delimiters or encodings?
Yes, configure CSV settings via `configureCsv()` before importing. For example, `(new FastExcel)->configureCsv(';', '#', 'gbk')->import('file.csv')` handles semicolon-delimited GBK-encoded files.
Can I directly download an Excel file from a Laravel controller?
Absolutely. Use `download()` to stream the file to the browser: `return (new FastExcel(User::all()))->download('report.xlsx');`. This works seamlessly with Laravel’s HTTP responses.
What Laravel and PHP versions does FastExcel support?
FastExcel requires **PHP 8.0+** and **Laravel 9+**. It leverages Spout v3, so ensure your server and CI/CD pipelines meet these requirements. Older versions (PHP 7.1) are unsupported.
How does FastExcel handle large datasets (e.g., 100K+ rows)?
FastExcel uses Spout’s streaming architecture to avoid memory overload. For very large exports, queue the job with Laravel Queues to prevent timeouts or use chunking for database inserts.
Can I map imported rows directly to database inserts?
Yes. Pass a callback to `import()` to transform rows into database records. Example: `(new FastExcel)->import('users.xlsx', fn($row) => User::create($row))` inserts each row as a new model.
Does FastExcel work with Laravel Nova for custom exports?
Yes, FastExcel integrates easily with Nova. Add export buttons to Nova resources by returning a `FastExcel` instance from a custom action, enabling admin users to download Excel files directly.
What are the alternatives to FastExcel for Laravel Excel exports?
Compare **Laravel Excel** (feature-rich, supports templates) or **PhpSpreadsheet** (advanced Excel features like charts). FastExcel prioritizes speed and simplicity for bulk data operations.
How do I handle file uploads larger than 100MB in FastExcel?
FastExcel processes files in streams, but for very large uploads, preprocess files client-side (e.g., chunk uploads) or use Laravel’s `request()->file()->getRealPath()` with caution to avoid memory issues.
Is FastExcel suitable for real-time Excel updates (e.g., WebSocket-driven)?
No, FastExcel is optimized for batch processing, not real-time streaming. For live updates, consider WebSocket libraries paired with a separate API endpoint for incremental data pushes.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport