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 properly handle exception inside controller?

I am trying to upload a file. And if it throws an exception I don't want to see the "whoops" page. Instead it will go back the previous page with a message. This is what I tried, try { $data = Excel::toArray(new Import, request('file')); } catch…
Nabil Farhan
  • 1,444
  • 3
  • 25
  • 41
0
votes
1 answer

Make the equivalent of pandas.read_csv(file) with Laravel Excel

I'm trying to read a .csv/.xlsx file using Laravel Excel in the same manner as you would do with the Python library pandas, with the function read_csv(), but instead of saving the file contents to a DataFrame I want them in a collection. So pretty…
Jodyra
  • 1
  • 2
0
votes
1 answer

Laravel Excel passing argument

I'm trying to pass argument to filter the data I want to export to Excel. This is my code : class UnitExport implements FromCollection { public function collection($proj_id) { return Unit::where('project_id', $proj_id); …
M.Izzat
  • 1,086
  • 4
  • 22
  • 50
0
votes
2 answers

Laravel excel can't handle japanese heading properly

I am using laravel excel to upload a excel file. The file contains heading at the very top. However, when the heading is in Japanese it is not being processed properly. For example, if my file is like +---------+--------+-------+ | bango | name …
Nabil Farhan
  • 1,444
  • 3
  • 25
  • 41
0
votes
2 answers

Adding an image to laravel-excel header

I'm making an excel export using the Maatwebsite/Laravel-Excel version 3.1. I am trying to add an image to the header of every page but it doesn't seem to work. I tried following the phpspreadsheet documentation for inserting image, but that…
0
votes
2 answers

Where to place view files for Laravel Excel?

I have code to export data to blade template: namespace App\Exports; use Illuminate\Contracts\View\View; use Maatwebsite\Excel\Concerns\FromView; class InvoicesExport implements FromView { public function view(): View { return…
user3573738
0
votes
1 answer

Import Excel files in Laravel 5.1

I have a Laravel 5.1 application and I want to import some Excel file to storage that data in my database. I found one solution, the Maatwebsite/Laravel-Excel, but when I add "maatwebsite/excel": "~2.1.0" to my composer.json and run a composer…
ArthurUF
  • 11
  • 1
0
votes
1 answer

Trait 'Exportable' not found in Laravel Excel?

I have imports: namespace App\Http\Controllers; use Maatwebsite\Excel\Concerns\FromQuery; use Maatwebsite\Excel\Concerns\WithTitle; use Maatwebsite\Excel\Facades\Excel; use Exportable; use Maatwebsite\Excel\Concerns\WithMultipleSheets; And…
POV
  • 11,293
  • 34
  • 107
  • 201
0
votes
1 answer

How to build Excel with two sheets and download?

I use Laravel Excel and that is full code:
POV
  • 11,293
  • 34
  • 107
  • 201
0
votes
1 answer

How to create drop down list in excel using laravel-excel or phpspreadsheet?

I am using laravel-excel 3.0 in my laravel project and i am unable to create drop-down list while downloading the list. Below is Export class code class MasterFields implements FromView { public function view(): View { return…
Juluri Vinay
  • 105
  • 3
  • 14
0
votes
1 answer

Laravel: Too few arguments to function App\Exports\JobExport::__construct(), 0 passed

I'm trying to export to Excel from Query but give me an error Too few arguments to function App\Exports\JobExport::__construct(), 0 passed and exactly 1 expected App\Exports: use App\Applyed; use Maatwebsite\Excel\Concerns\FromCollection; use…
Hima Hima
  • 123
  • 16
0
votes
1 answer

laravel-excel Undefined index: $

I try to import and show details in blade php If comment this section, there's no error $results = Excel::load('files/' . $file_name, function($reader){ $reader->all(); })->get(); i want to read and display the details from excel sheet…
SAJJADH A.W
  • 31
  • 1
  • 1
  • 6
0
votes
1 answer

Styling excel in Laravel with Laravel Excel

Learning Laravel, I face now Excel export. Searching in the Intenet Laravel Excel (docs.laravel-excel.com) seems to be the better choice, but I'm findind it very difficult to style the sheets (colors, fonts, sizes, etc.) I'm using global event…
Jaime
  • 328
  • 1
  • 6
  • 19
0
votes
2 answers

Map query result with multiple headings using laravel excel

I am exporting an excel using Laravel excel 3.1 by Maatwebsite. I want to map it with 2 headings and display it one below the other I'm using WithHeadings, WithMapping, FromArray I'm getting the records, just the format that needs…
Adil
  • 43
  • 2
  • 7
0
votes
1 answer

WithChunkReading reads rows beyond the maximum rows filled

I am trying to import excel file over 6610 records, with Maatwebsite-excel v3.1. I have implemented the import class that implements ChunkReading too. After inserting the last record in database,the excel-import implementation even considers 6611th…