hero

Laravel Excel

Supercharged Excel exports in Laravel

Read documentation →

💪 Export collections to Excel.

Supercharge your Laravel collections and export them directly to an Excel or CSV document. Exporting has never been so easy.

🚀 Supercharged exports.

Export queries with automatic chunking for better performance. For even more superpowers, exports can also be queued.

🔥 Export blade views.

Want to have a custom layout in your spreadsheet? Use a HTML table in a blade view and export that to Excel.

💡 Install the package via composer

composer require maatwebsite/excel
1

💪 Create an export class

php artisan make:export UsersExport --model=App\\User
1

🔥 Download your export

<?php 

use App\UsersExport;
use Maatwebsite\Excel\Facades\Excel;
use App\Http\Controllers\Controller;

class UsersController extends Controller 
{
    public function export() 
    {
        return Excel::download(new UsersExport, 'users.xlsx');
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13