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
1 answer

Place a column at the end of a collection in laravel excel

I have an excel file that has a query to get the neighborhoods, and the total record for each neighborhood. But how can I put at the end, when all the data of the query is placed in the excel a custom column that is the sum or the total of the…
Alezco05
  • 453
  • 1
  • 7
  • 22
0
votes
1 answer

laravel-excel 3.1 with laravel framework 6.2 and php 7.4

I have problem with laravel-excel 3.1 after i have been upgrade laravel version and php version i got some requirement from laravel to upgrade laravel-excel too. after that i got problem with excel-export not support new version(3.1) before i use…
Sam
  • 51
  • 1
  • 2
0
votes
1 answer

Can't import less than 5 rows in Laravel/Excel

I am trying to import multiple rows from Excel file to the database. If rows are equal to 5 or greater the records successfully adds to the database but if I try less than 5 records it gives SQL error. SQLSTATE[23000]: Integrity constraint…
Ihtisham Khan
  • 417
  • 5
  • 20
0
votes
2 answers

Laravel Excel landscape page

I'm using Laravel-Excel to create excel files with Laravel. I need to set page orientation to landscape, But I can't find the solution in official documentation. By the way I'm using Blade to create excel file and this is my code. class ExampleExcel…
Logan
  • 3
  • 2
0
votes
1 answer

Laravel Excel ErrorException Undefined offset: 0

Trying to import excel data to my mysql db and getting ErrorException Undefined offset: 0. Tried using var_dump($row) to check the array of the row of the data. It looks off and not sure how to make the data shows nicely so that able to pass to…
N.Tec
  • 127
  • 2
  • 13
0
votes
1 answer

Convert xlsx to pdf using Laravel Excel

I'm trying to use Laravel Excel (maatwebsite) to build a simple function to upload an Excel file and convert it to pdf straight away. I'm looking for something like that (conceptual obviously) : $file = $request->file('my_excel'); $excel_object =…
Adam Dulson
  • 283
  • 5
  • 16
0
votes
2 answers

Laravel Excel - MaatWebsite/Excel's Import Operation raising DB Connection not Configured error

I am using Laravel 6.2 and Maatwebsite/Excel 3.1 here I am trying to import a excel file and willing to get data present in it in an Array format and in the Controller I need to validate some data among them and along with some other fields i need…
0
votes
1 answer

Create the appearance of a "Table" with cells, from a Multi-Dimensional Collection

I have the following manually created Excel "table" which I'm trying to duplicate in Laravel-Excel 3.1. Here is what my collection looks like as json: "missingData": { "2010": { "Jan": { "count": 45 }, "Feb":…
Ajility
  • 526
  • 3
  • 19
0
votes
1 answer

how to get path laravel with error mk such no such dir or file?

I want to know what the error, because i think my path are correct but still giving me error as path here is the code public function importfile(Request $request){ $validator = Validator::make($request->all(), [ 'file' =>…
0
votes
0 answers

Laravel-Excel keeps browser busy for 140 seconds after completion of import: how do I correct it?

Using the import to models option, I am importing an XLS file with about 15,000 rows. With the microtime_float function, the script times and echos out how long it takes. At 29.6 secs, this happens, showing it took less than 30 seconds. At that…
user1729972
  • 712
  • 2
  • 9
  • 29
0
votes
1 answer

How Do I resolve "Illuminate\Queue\InvalidPayloadException: Unable to JSON encode payload. Error code: 5"

Trying out the queue system for a better user upload experience with Laravel-Excel. .env was been changed from 'sync' to 'database' and migrations run. All the necessary use statements are in place yet the error above persists. The exact error…
user1729972
  • 712
  • 2
  • 9
  • 29
0
votes
1 answer

Error while applying color to excel cell in laravel excel export

I am exporting excel for bulk upload in PHP laravel. I am applying color to cell applying the following method:- public function styles(Worksheet $sheet) { return [ 'A1' => [ 'fill' => [ …
Kishan
  • 13
  • 8
0
votes
1 answer

Unable to insert Chinese characters into MySQL db Despite creating table with utf8mb4/utf8mb4_general_ci

I've read a lot of posts on Stackoverflow and generally and they still do not seem to address my situation. Running Laravel 7.x on PHP 7.4, I'm using Laravel-Excel to import into the db. Screenshot shows my database.php and table have the…
user1729972
  • 712
  • 2
  • 9
  • 29
0
votes
0 answers

Counter resets to zero after every chunk in Laravel Excel import

I am importing a CSV using maatwebsite/excel package. The CSV contains over 100 million rows, so I'm using WithChunkReading. I'm also logging each row insertion. protected $rowCount = 0; public function collection(Collection $rows): bool { …
Qumber
  • 13,130
  • 4
  • 18
  • 33
0
votes
1 answer

How to save the csv when i import it in Laravel

i am new in Laravel, and i have an import list page (this page work very good), this import some list to put on database. But i want to save this list too. Heres my code (CsvImport.php):
seique3
  • 19
  • 6