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
6
votes
3 answers

How to set background color for row in Laravel Excel?

I use Laravel Excel library and I have tried this code: public function registerEvents(): array { return [ AfterSheet::class => function(AfterSheet $event) { $styleArray = array('fill' => array( 'color'…
POV
  • 11,293
  • 34
  • 107
  • 201
6
votes
4 answers

add custom column to laravel excel

I am using maatwebsite/excel, I want to know if it's possible to add custom column when I export my data as CSV or not? Explanation I am successfully exporting my products data, but my products have other option which is not stored in my products…
mafortis
  • 6,750
  • 23
  • 130
  • 288
5
votes
1 answer

Laravel Excel is working but the file cannot be opened

I am using the Laravel Excel to create excel documents with many sheets. I have been following their example of how they do it, but when I go to download the file its: Excel cannot open the file 'kingdoms (1).xlsx' because the file format or file…
TheWebs
  • 12,470
  • 30
  • 107
  • 211
5
votes
1 answer

Laravel 7 w/ Laravel Excel: Your requirements could not be resolved to an installable set of packages

I'm trying to install Laravel Excel in Larevel 7 running in a Docker container with PHP 7.4 but I get this error that I can't figure out how to fix. e-learning-app/src on  dev [$!] via ⬢ v12.8.1 via v7.4.4 ➜ docker:composer require…
Diego Ulloa
  • 500
  • 8
  • 19
5
votes
2 answers

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

I made import data using Excel on Laravel Maatwebsite Excel 3.1. but when in the database there is the same data (Primary Key) then there is an error message integrity constraint violation: 1062 Duplicate entry '188281' for key 'PRIMARY' I have…
Tammam
  • 416
  • 1
  • 7
  • 16
5
votes
1 answer

How can I change color a character laravel excel maatwebsite?

I get tutorial from here : https://laravel-excel.maatwebsite.nl/3.0/exports/extending.html So I use version 3 My excel like this : I want to change it to be like this : So I want the character England change to red color and bold I try like this…
moses toh
  • 12,344
  • 71
  • 243
  • 443
5
votes
2 answers

How can I pass parameter in the laravel excel?

I get tutorial from here : https://laravel-excel.maatwebsite.nl/docs/3.0/export/basics
moses toh
  • 12,344
  • 71
  • 243
  • 443
5
votes
1 answer

How to read xls file in laravel - laravel-excel

I'm using laravel-excel library to read excel files. http://www.maatwebsite.nl/laravel-excel/docs/import //http://localhost:8000/assets/panel/excel/test123.xls $address = URL::to('/assets/panel/excel/').'/test123.xls'; // dd($address); …
S.M_Emamian
  • 17,005
  • 37
  • 135
  • 254
5
votes
1 answer

Laravel-Excel (MaatWebSite) takes to long reading

I dont know what im doing wrong, or maybe its something normal. I have to load and "read" a excell with about 12000 rows. I use this code for that. Excel::selectSheetsByIndex(0)->load($path.$fileName, function ($reader) { …
Sampudon
  • 85
  • 1
  • 8
5
votes
1 answer

Laravel 5 Excel installation failure

I am having a rough time trying to install the Laravel Excel (http://www.maatwebsite.nl/laravel-excel/docs) package to my Laravel 5. Here's what I've done so far: Added "maatwebsite/excel": "2.*" to my require, composer update finishes just fine…
Salkz
  • 1,062
  • 9
  • 17
5
votes
1 answer

laravel-excel not working to export xls file using blade with image

Excuse me, I want to use laravel-excel to export my report. This is the controller: public function getExcelfile(){ $users = UserService::findAllPublic(); $total = UserService::count(); $total_with_photo =…
Khaneddy2013
  • 1,301
  • 1
  • 17
  • 25
4
votes
1 answer

How to export large number of rows using laravel excel

I need to export huge amount of rows to Excel. I am using Laravel-excel. I followed all the suggestions given in documentation for exporting large database. // routes/web.php Route::post('/dashboard/export', [DashboardController::class,…
Abhinav Keshri
  • 595
  • 5
  • 20
4
votes
1 answer

Laravel Excel not chunking and timing out

Here is my controller action: public function export() { (new ItemsExport)->queue('items.xlsx')->chain([ new ExportItemsEmail(auth()->user()), ]); return redirect()->back()->with('success', 'File will be emailed to you once…
TheWebs
  • 12,470
  • 30
  • 107
  • 211
4
votes
1 answer

laravel excel with upserts not updating data

I have a csv file with data inside. I want import it to my database. If there's repeated data in csv file, I don't want it to create new repeated records, what I want is to update it. But the problem is, it's creating new repeated…
Ricardinho
  • 599
  • 9
  • 22
4
votes
4 answers

How to make all cells wrap text and have complete all borders in Laravel Excel

I want to make export results with Laravel Excel, but the results did not match what I wanted. what I want is like this I want all cells to be wrapped in text and have a complete border. This is my code: class SdgsExportView2 implements FromView,…
1
2
3
37 38