
Laravel Excel 3.0
Laravel Excel is a package by Maatwebsite that makes working with spreadsheets easy. It’s been out since 2013 and just recently released version 3.0 with some important breaking changes.
In their lessons learned post they go through the history of the project and why they have decided to make v3.0 a major breaking change from previous releases:
My goal for Laravel Excel 3.0 is to cater our own needs first and only add convenience methods that we need and would use ourselves, instead of re-inventing the PhpSpreadsheet “wheel”. The less code to solve the problem, the easier it should be to maintain.
The post is worth checking out specifically to look at opensource from the maintainer’s point of view and how it’s easy to let people change your goals to suit them. This quote is so perfect:
Laravel Excel used to be an opinionated PHPExcel but became an un-opinionated Excel for Laravel.
Laravel Excel 3.0 is now released and this version mainly focuses on exports and making it as simple as possible and is a complete break from previous versions. Here are some of the highlights from this release:
- Easily export collections to Excel
- Export queries with automatic chunking for better performance
- Queue exports for better performance
- Easily export Blade views to Excel
To give you an example of exporting in 3.0, take a look at this quick example taken from their documentation.
First, create an InvoicesExport class:
namespace App\Exports;
class InvoicesExport implements FromCollection
{
public function collection()
{
return Invoice::all();
}
}
Next, from your controller initialize the download:
public function export()
{
return Excel::download(new InvoicesExport, 'invoices.xlsx');
}
Or get fancy and store it to S3:
public function storeExcel()
{
return Excel::store(new InvoicesExport, 'invoices.xlsx', 's3');
}
Of course, these examples just scratch the surface. Check out the Github repo and official docs for more information.
As mentioned above, v3.0 focuses on exporting and v3.1 will focus on imports, but as of this time, there isn’t a planned release date yet.
Filed in: Laravel Packages
Enjoy this? Get Laravel News delivered straight to your inbox every Sunday.
No Spam, ever. We'll never share your email address and you can opt out at any time.
Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.
Laravel Jobs

- PHP Web Developer
-
Orlando, FL
Christ for all Nations - PHP Developer
-
Manhattan, KS (open to Remote)
CivicPlus - Mid-Senior Laravel Developer
-
Exeter
Optix Solutions - Full Stack Web Developer
-
Las Vegas, NV
V Shred - Staff Software Engineer (Laravel)
-
Remote
smartbnb - Software Engineer (PHP, Laravel, Vue)
-
Los Angeles, CA
Relocity - Software Engineer Level 1 / Level 2
-
St. Pete. / Tampa Area, FL / Remote
ShineOn
Uploading Avatar Images with Spatie’s Media Library
By default, the Laravel registration form comes with the name, email, and password fields, but often it’s usefu…
Getting Started with Signed Routes in Laravel
Laravel includes the ability to create signed URLs and in this article, we’ll work on enabling signed URLs in a…