Branch: master
Clone or download
patrickbrouwers Merge pull request #44 from Maatwebsite/xls-import-queue
Add note for not queueing xls imports.
Latest commit 1492896 Feb 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vuepress Fix value binder docs Feb 14, 2019
2.1 Test Laravel Excel 3.1 and update documentation accordingly Sep 28, 2018
3.0 Update support.md Jan 2, 2019
3.1 Add note for not queueing xls imports. Feb 15, 2019
nova Fix nova redirect Oct 30, 2018
.gitignore Add blog page to nav Aug 10, 2018
README.md Improve docs with toc Jan 30, 2019
package.json Update vuepress Jan 30, 2019
yarn.lock Update vuepress Jan 30, 2019

README.md

home heroImage actionText actionLink features footer
true
/assets/img/logo-small.png
Read documentation →
/3.1/getting-started/
title details
💪 Export to Excel.
Supercharge your Laravel collections or Blade views and export them directly to an Excel or CSV document. Exporting has never been so easy.
title details
🚀 Supercharged exports.
Export queries with automatic chunking for better performance. For even more superpowers, exports can also be queued.
title details
🔥 Supercharged imports.
Import workbooks and worksheets to Eloquent models with chunk reading and batch inserts! You can also queue every chunk of a file! Your entire import will happen in the background.
MIT Licensed | Powered by Maatwebsite

💡 Install the package via composer.

composer require maatwebsite/excel

💪 Create an export and import class.

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

🔥 Download your export and import your file.

<?php 

use App\Exports\UsersExport;
use App\Imports\UsersImport;
use Maatwebsite\Excel\Facades\Excel;
use App\Http\Controllers\Controller;

class UsersController extends Controller 
{
    public function export() 
    {
        return Excel::download(new UsersExport, 'users.xlsx');
    }
    
    public function import() 
    {
        return Excel::import(new UsersImport, 'users.xlsx');
    }
}