Questions tagged [laravel-excel]

Import and export Excel and CSV files in Laravel (based on PhpSpreadsheet)

Import and export Excel and CSV files using Laravel code. Supported formats: XLSX, CSV, TSV, ODS, XLS, HTML.

Reference

563 questions
0
votes
2 answers

How to foreach inside return?

Im building my first laravel website, and try to setup Maatwebsite\laravel-excel package the form value from the view already passed to controller variable. and now im setting the Model using FromQuery and WithMapping. but i got problem when try to…
Mafaza SP
  • 81
  • 7
0
votes
1 answer

Laravel import excel file to database

When I import the excel file to the database, the file imported to the database but it inserts together with the excel first row which is the column name, I don't know how to make it upload only the data start from the second row. Below is the code…
Gucci Gang
  • 19
  • 1
  • 3
0
votes
1 answer

Getting exception "PhpOffice \ PhpSpreadsheet \ Reader \ Exception" when parsing specific csv file

Something in a csv file I am trying to import using Maatwebsite's Laravel Excel package (which uses PhpOffice's PhpSpreadsheet package) is causing the import to blow up with the following exception: PhpOffice \ PhpSpreadsheet \ Reader \…
Jason Ayer
  • 621
  • 1
  • 10
  • 20
0
votes
1 answer

How to fix 'Allowed memory size' when exporting large array data using Laravel Excel 2.1?

I'm setting up an export feature based on the generated report, and am having problems when inserting large array rows/data to a sheet using Laravel Excel 2.1's fromArray method. Is there any alternate way to do this to not get 'Allowed memmory size…
MiniDr
  • 191
  • 1
  • 11
0
votes
1 answer

Laravel Excel pass variable

I'm exporting an excel file to a database using Laravel excel class StudentsImport implements ToModel { public function model(array $row) { return new Students([ 'student_name' => $row[0], 'student_email' => $row[1], …
user3714932
  • 1,253
  • 2
  • 16
  • 29
0
votes
1 answer

faster large data exports in laravel to avoid timeouts

I am to generate a report from the database with 1000's of records. This report is to be generated on monthly basis and at times the user might want to get a report spanning like 3 months. Already as per the current records, a month's data set can…
Johhn
  • 979
  • 17
  • 24
0
votes
0 answers

Add sheet to existing excel file with Laravel Excel

I am using Laravel Excel 2.1. I have an array of data that I want to add as a new sheet to an existing excel file and save it locally. Here is the code I am trying Excel::load(base_path() . '/storage/app/surveyFilters/' . $surveyFilter->filename,…
Chris
  • 486
  • 3
  • 8
  • 22
0
votes
0 answers

How to fix Serialization of 'MongoDB\Driver\Manager' is not allowed in Laravel Excel

I'm trying to export a mongoDB model using queue, but always returns the exception "Serialization of 'MongoDB\Driver\Manager' is not allowed". I found this issue in github (https://github.com/Maatwebsite/Laravel-Excel/issues/1760), but I don't know…
Draake
  • 93
  • 1
  • 16
0
votes
2 answers

Laravel Excel 3.1 throws a "property doesnt have a default value" error despite importing successfully

I am using the Laravel Excel package to handle bulk uploads. Whilst Im able to get the data to upload successfully, my web console indicates and error that 'staff_id' doesn't have a default value. I have tried to catch this as an exception but this…
Francis Kisiara
  • 125
  • 2
  • 14
0
votes
1 answer

PHP - Pass parameters throughout deep levels of callback function

I'm using Laravel-Excel library to develop an export xls function. I need to add a value to specific cell. As documentation, I wrote script $data = MyModel::getComplexData(); Excel::create('Export payroll', function($excel) use ($data) { …
Thanh Dao
  • 1,218
  • 2
  • 16
  • 43
0
votes
0 answers

Laravel Excel doesn't read any values

I have a spreadsheet which I wanna read to get values to my database but when checking with var_dump() it reads every row as NULL. The Excel file is a XLSX. Something odd about this spreadsheet is that it starts at row 11 but I need to get some…
ffuentes
  • 1,042
  • 5
  • 16
  • 36
0
votes
0 answers

Laravel Excel, previously working downloads won't open now (corrupted file, incorrect extension)

I've been using laravel excel to download array data for a few weeks and all of a sudden today, the download won't open. It gives an incorrect extension type (xlsx) and says it may be corrupted. There is no whitespace before my
Geoff_S
  • 4,917
  • 7
  • 43
  • 133
0
votes
2 answers

Laravel Excell: SQLSTATE[25000] while importing XLS to SQL Server DB

I'm trying to implement import from XLS file to Orders table in my Laravel project with SQL server database. For this purpose I use Laravel Excell package: https://laravel-excel.maatwebsite.nl/ . I get following error while trying to test an…
TheVic
  • 303
  • 6
  • 16
0
votes
2 answers

Could not open /var/folders/n_/ laravel-excel.maatwebsite

i want to create download excel function using laravel-excel.maatwebsitelibrary. my code like below : return Excel::download(new PembukuanExport, 'pembukuan.xlsx'); but when i ran it, it gave me error like this Could not open…
Good Day
  • 385
  • 7
  • 21
0
votes
0 answers

Laravel Maatwebsite only readying excel file without create Import & saving file

Currently i want to working with excel file. ( with Maatwebsite/Laravel-Excel ) the step is post upload the file I don't want to store the file first I want to read the excel file , without first creating the Import Class anyone have the…
igniz87
  • 164
  • 1
  • 13