Skip to content

iritec/Laravel-Excel

Repository files navigation

Laravel Excel

Laravel Excel 3.0

馃挭 馃敟 馃殌

Supercharged Excel exports
A simple, but elegant wrapper around PhpSpreadsheet with the goal of simplifying exports.

Build Status StyleCI Latest Stable Version Total Downloads License

  • Easily 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 peformance. You provide us the query, we handle the performance. Exporting even larger datasets? No worries, Laravel Excel has your back. You can queue your exports so all of this happens in the background.

  • 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.

馃殌 5 minutes quick start

馃挕 Require this package in the composer.json of your Laravel project. This will download the package and PhpSpreadsheet.

composer require maatwebsite/excel

馃挭 Create an export class in app/Exports

php artisan make:export UsersExport --model=User

This should have created:

<?php

namespace App\Exports;

use App\User;
use Maatwebsite\Excel\Concerns\FromCollection;

class UsersExport implements FromCollection
{
    public function collection()
    {
        return User::all();
    }
}

馃敟 In your controller you can call this export now:

use App\Exports\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');
    }
}

馃搫 Find your users.xlsx in your downloads folder!

More installation instructions can be found at: https://laravel-excel.maatwebsite.nl/3.0/getting-started/installation.html

馃帗 Learning Laravel Excel

You can find the full documentation of Laravel Excel on the website.

We welcome suggestions for improving our docs. The documentation repository can be found at https://github.com/Maatwebsite/laravel-excel-docs.

馃敡 Supported Versions

Versions will be supported for a limited amount of time.

Version Laravel Version Php Version Support
2.1 <=5.6 <=7.0 EOL on 15-5-2018
3.0 ^5.5 ^7.0 New features

馃攷 Roadmap

Imports are currently not supported by 3.0. This functionality will be re-added in 3.1. 3.1 is planned to be released in October 2018.

馃摤 License & Postcardware

Our software is open source and licensed under the MIT license.

If you use the software in your production environment we would appreciate to receive a postcard of your hometown. Please send it to:

Maatwebsite
Florijnruwe 111-2
6218 CA Maastricht
The Netherlands

More about the license can be found at: https://laravel-excel.maatwebsite.nl/3.0/getting-started/license.html

About

馃殌 Supercharged Excel exports in Laravel

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.8%
  • HTML 0.2%