An eloquent way of importing and exporting Excel and CSV files for Laravel 4.* & Laravel 5.* with the power of PHPOffice's PHPExcel
Questions tagged [maatwebsite-excel]
590 questions
28
votes
8 answers
Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?
By using Maatwebsite/Laravel-Excel version 3.1 to import excel sheet, here I faced an issue date time column of the excel sheet returns unknown number. How to solve this? Example : Consider Cell value "29/07/1989" and returns as "32178" when import.

Reno Anthus
- 714
- 1
- 9
- 13
25
votes
5 answers
How to skip first row when importing file
I'm trying to import an .xlsx file in Laravel version 5.7 using Maatwebsite-excel version 3.1. What I want to achieve is to skip the first row of the file to avoid importing column headers in my database.
I've tried to use version 2 syntax, calling…

LDUBBS
- 593
- 2
- 8
- 20
22
votes
6 answers
Call to undefined method Maatwebsite\Excel\Excel::load()
I'm trying to import excel file (.xlsx) using maatwebsite 3.0. How to fix This error
Call to undefined method Maatwebsite\Excel\Excel::load()
My controller
public function importsave(Request $request)
{
if($request->hasFile('excel'))
{
…

Rio Aditya
- 253
- 1
- 2
- 7
17
votes
8 answers
Laravel maatwebsite/excel composer install error in mac
Trying to install maatwebsite/excel in XAMPP 7.1.32 rev 1 via composer for mac.
How do I enable these extensions in XAMPP for mac or is there any other issue. Please help me.
composer install
Loading composer repositories with package…

Neeraj
- 231
- 1
- 3
- 10
15
votes
4 answers
Laravel excel library(Maatwebsite) : How to create a drop down list in exports
I am creating an excel template which should contain a dropdown list. I see its possible with the phpexcel library (PHPExcel Multiple Dropdown list that dependent).
I was wondering if it could be done with the laravel-excel library provided by…

Sankalp Tambe
- 400
- 4
- 15
10
votes
4 answers
PHP Laravel read csv
I have a CSV file where the data is in landscape orientation.ex:
name, test name
age, 20
gender,Male
where the first column is the headers and the second the data, i tried using laravel maatwebsite/Excel and the response after reading the file, the…

Naveed Sheriffdeen
- 940
- 6
- 18
- 37
9
votes
1 answer
Corrupted composer.json file in Laravel 8
When I tried to remove the package maatwebsite/excel from my project, I damaged something badly. The problem is that I can't track the changes I made. Before I removed maatwebsite/excel from composer.json, I removed phpoffice/phpspreadsheet probably…

peterw
- 91
- 1
- 3
8
votes
7 answers
How to get excel to array in maatwebsite
I am trying to convert an Excel file to an array using the latest version of Laravel-Excel (3.1.9)
The code below will download the file:
return Excel::download(new SalesOrderExport('columns'),'test.xlsx')
But I need to convert it to get an array…

Niklesh Raut
- 34,013
- 16
- 75
- 109
7
votes
1 answer
Call to a member function all() on array laravel excel
i'm using laravel maatwebsite excel,
i tried passing variable and do some action and return as array to export,
So i get the Error when i tried to pass array to the main controller for excel export(download)
my main controller
public function…

teenage vampire
- 339
- 1
- 5
- 13
7
votes
5 answers
Laravel Excel - Error Allowed memory size
I use Maatwebsite to load excel files. I'm loading fine several documents, until it gives the next error:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in…

user3242861
- 1,839
- 12
- 48
- 93
7
votes
2 answers
Reading excel file in Laravel
I'm using Maatwebsite's library for reading and creating excel file. The creating was easy and somehow intuitive, but when it comes to reading one, I simply can't figure it out.
This is how my excel file looks like:
I figured out how to loop…

Andrej
- 384
- 1
- 6
- 23
6
votes
1 answer
How Can I set dynamic number format with separator in laravel excel maatwebsite?
I have an amount column and I want to set integer format when the number does not have a decimal and double format when the number has a decimal. in both ways, I want to add separators to numbers.
currently, I use bindValue but excel cells don't…

Hossein Askari
- 123
- 9
6
votes
1 answer
Laravel excel add complex headers to an export
I need to export a sheet with a complex heading via Laravel Excel. I need a main heading and another sub-level heading after.
I'm trying like this,
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadings;
class…

vimuth
- 5,064
- 33
- 79
- 116
6
votes
1 answer
Return variable from within Laravel Excel Import
Code Below, basic example, but I want to return errors (see commented out if statement after the import ). How would I pass variables from the 'import' class back to the controller?
Controller:
public function resultsImport(Request $request)
{
…

SupaMonkey
- 876
- 2
- 9
- 25
6
votes
6 answers
How to skip blank rows in maatwebsite-excel 3.1 for model-way import on Laravel
I'm working on laravel project with maatwebsite-exvel 3.1 to import excel file from file uploding method. This is my StudentsImport class.
public function model(array $row)
{
return new Student([
'school_uuid' =>…

joenpc npcsolution
- 737
- 4
- 11
- 25