Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

Laravel-Excel

An eloquent way of importing and exporting Excel and CSV files for Laravel with the power of PHPExcel

Star full 4f7b624809470f25b6493d5a7b30d9b9cb905931146e785d67c86ef0c205a402Star full 4f7b624809470f25b6493d5a7b30d9b9cb905931146e785d67c86ef0c205a402Star full 4f7b624809470f25b6493d5a7b30d9b9cb905931146e785d67c86ef0c205a402Star full 4f7b624809470f25b6493d5a7b30d9b9cb905931146e785d67c86ef0c205a402Star half bd79095782ee4930099175e5ce7f4c89fa3ddabcd56fffcc7c74f6f2a2d46b27 (3 ratings)
Rated 4.83 out of 5
Subscribe to updates I use Laravel-Excel


Statistics on Laravel-Excel

Number of watchers on Github 4626
Number of open issues 398
Average time to close an issue 5 days
Main language PHP
Average time to merge a PR 4 days
Open pull requests 26+
Closed pull requests 37+
Last commit over 1 year ago
Repo Created almost 6 years ago
Repo Last Updated over 1 year ago
Size 1.37 MB
Homepage https://laravel-e...
Organization / Authormaatwebsite
Latest Release2.1.27
Contributors43
Page Updated
Do you use Laravel-Excel? Leave a review!
View open issues (398)
View Laravel-Excel activity
View on github
Fresh, new opensource launches πŸš€πŸš€πŸš€
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating Laravel-Excel for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)
What people are saying about Laravel-Excel Leave a review
Its easy and simple

Laravel Excel v2.1.* for Laravel 5

Looking for Laravel Excel for Laravel 4? Visit the 1.3 branch

Laravel Excel brings the power of PHPOffice's PHPExcel to Laravel 5 with a touch of the Laravel Magic. It includes features like: importing Excel and CSV to collections, exporting models, array's and views to Excel, importing batches of files and importing a file by a config file.

  • Import into Laravel Collections
  • Export Blade views to Excel and CSV with optional CSS styling
  • Batch imports
  • A lot of optional config settings
  • Easy cell caching
  • Chunked and queued importer
  • ExcelFile method injections
  • Editing existing Excel files
  • Advanced import by config files
  • and many more...

Excel::create('Laravel Excel', function($excel) {

    $excel->sheet('Excel sheet', function($sheet) {

        $sheet->setOrientation('landscape');

    });

})->export('xls');

Build Status Latest Stable Version Total Downloads License Monthly Downloads Daily Downloads

Installation

Require this package in your composer.json and update composer. This will download the package and PHPExcel of PHPOffice.

composer require "maatwebsite/excel:~2.1.0"

In Laravel 5.5 or higher, this package will be automatically discovered and you can safely skip the following two steps.

If using Laravel 5.4 or lower, after updating composer, add the ServiceProvider to the providers array in config/app.php

Maatwebsite\Excel\ExcelServiceProvider::class,

You can use the facade for shorter code; if using Laravel 5.4 or lower, add this to your aliases:

'Excel' => Maatwebsite\Excel\Facades\Excel::class,

The class is bound to the ioC as excel

$excel = App::make('excel');

To publish the config settings in Laravel 5 use:

php artisan vendor:publish --provider="Maatwebsite\Excel\ExcelServiceProvider"

This will add an excel.php config file to your config folder.

Documentation

The complete documentation can be found at: https://laravel-excel.maatwebsite.nl/docs

Support

Support only through Github. Please don't mail us about issues, make a Github issue instead.

Contributing

ALL bug fixes should be made to appropriate branch (e.g. 2.0 for 2.0.* bug fixes). Bug fixes should never be sent to the master branch.

More about contributing can be found at: https://laravel-excel.maatwebsite.nl/docs/2.1/getting-started/contributing

License

This package is licensed under MIT. You are free to use it in personal and commercial projects. The code can be forked and modified, but the original copyright author should always be included!

FAQ

1) Chunk importer only imports the first row

Check that auto_detect_line_endings in your php.ini is set to true.

Laravel-Excel open issues Ask a question     (View All Issues)
  • almost 3 years [BUG] Export XLS or XLSX
  • almost 3 years UTF-8 encoding in CSV export?
  • almost 3 years Encode problem for import csv
  • almost 3 years [QUESTION] Prevent CSV Injection
  • almost 3 years QUESTION_Excel Export not start from A1
  • almost 3 years [QUESTION] Handle ErrorException
  • almost 3 years there seems to be problem with editing the existing file, can someone help me out here
  • almost 3 years [QUESTION] Setting custom headers missing in LaravelExcelWorksheet
  • almost 3 years PHPExcel_Calculation_Exception in Cell.php line 293: Credit Repair_Dashboard!F2 -> Credit Repair_Dashboard!F12 -> Formula Error: An unexpected error occured
  • almost 3 years Open a excel file, modify and import to database table.
  • almost 3 years i am trying to update the data table from excel sheet in laravel then i am getting an error:
  • almost 3 years [QUESTION] 502 Bad Gateway
  • almost 3 years [QUESTION] Laravel (5.2) Excel download xlsx error ERR_INVALID_RESPONSE (chrome)
  • almost 3 years [Question] - chart doesn't appear
  • almost 3 years [BUG]Β Caching driver: temp
  • almost 3 years [QUESTION] No handler registered for command [Maatwebsite\Excel\Readers\ChunkedReadJob]
  • almost 3 years [QUESTION] : Is there a way to check if a given sheet name exists on the Excel?
  • almost 3 years Chunk Import convert date into double
  • almost 3 years ChunkedReadJobHandler does not exist
  • almost 3 years using PHPExcel_Cell_DefaultValueBinder with $reader->all()->toArray() returns no parsed data.
  • almost 3 years [BUG] Can't format cells using setColumnFormat
  • almost 3 years [Question] How to add new sheet to existing excel file. Add as a different Sheet Tab
  • almost 3 years [QUESTION] mPDF config in Laravel-Excel
  • almost 3 years [BUG] Package conflict with current version of tijsverkoyen/css-to-inline-styles
  • almost 3 years [QUESTION] ignoreEmpty() are not 'ignoring'
  • about 3 years Does not work with Laravel 5.3
  • about 3 years [QUESTION] It is possible to get value of single cell or single row on import?
  • about 3 years [BUG] Right border is removed
  • about 3 years [QUESTION] How add sheet (view blade) to existing file?
  • about 3 years [QUESTION] Good way to parse chunks
Laravel-Excel open pull requests (View All Pulls)
  • Update README.md with Laravel 5.2 instructions
  • callback for config reader
  • Fix data being shifted when ignoreEmpty is set and cells in between o…
  • Update `Orchestra/TestBench` dependency for Laravel 5.2
  • [Fix] rowspan with colspan
  • Fix borders for merged cells
  • Fix heading generation when default overridden in settings.
  • Add .gitattributes file
  • Removed interface deprecated in laravel 5.2
  • Fixed double blockquote
  • Update css-to-inline-styles package to ~2.0
  • Solved problem with rowspan (#917)
  • Improve Lumen Support
  • Fix for issue #834 Can't Generate ods file
  • Fix missing method
  • fix bug of rowspan and colspan
  • custom seperators veriable added
  • Update HtmlReader.php
  • Enabling chunk file without header
  • Simplify returns
  • remove duplicate style when merge cell
  • Issue when version of laravel are less than 5.2
  • Add delimiter as 4th parameter for chunk method
  • Fix to prevent blank spreadsheets
  • Update composer.json
  • phpexcel is deprecated Issue #1509
Laravel-Excel questions on Stackoverflow (View All Questions)
  • Selecting a sheet using Laravel-Excel
  • Laravel excel library(Maatwebsite) : How to create a drop down list in exports
  • Load hyperlinks with Maatwebsite Laravel-Excel
  • Laravel Excel : Inserting Columns
  • Laravel Excel Loading a view for a single sheet
  • How to go through every field from the spreadsheet using Laravel-Excel
  • Laravel Excel , exporting from a model, styling issues
  • Insert image with Laravel-Excel
  • rename worksheet in laravel-excel
  • How to redirect after ->download() with Laravel Excel
  • How to rename file before ->download() with Laravel Excel
  • Reading csv with Laravel excel not working
  • Maatwebsite/Laravel-Excel export file success, but the file is core dump
  • import an excel file using laravel excel
  • Laravel Excel Download using Controller
  • Laravel-Excel Passing Variabel to ExportHandler
  • charts disappear on running laravel-excel
  • UTF-8 encoding issue with laravel excel library
  • Laravel Excel - Only returns first column of row
  • Laravel Excel export
  • How to export drop down list in laravel excel?
  • Laravel-Excel massive import
  • (maatwebsite) Laravel-excel. Is it possible to get the latest active row (or cell) while working with a blade view?
  • Laravel EXCEL and PDF export
  • Import not working properly in Laravel-Excel plugin
  • How can I apply borders to a specific cell with laravel excel?
  • Row 2 is out of range (2 - 1) laravel-excel
  • Laravel Excel/PHP Excel: Import, modify, download
  • create datatable from laravel excel array
  • Looping through an array within an array in laravel-excel
Laravel-Excel list of languages used
More projects by Maatwebsite View all
Other projects in PHP