sald19 / laravel-excel-docs

Laravel Excel Docs

Home Page:https://laravel-excel.maatwebsite.nl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

home heroImage actionText actionLink features footer
true
/assets/img/logo-small.png
Read documentation β†’
/3.1/
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');
    }
}

About

Laravel Excel Docs

https://laravel-excel.maatwebsite.nl/


Languages

Language:JavaScript 90.6%Language:CSS 9.4%