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
4 answers

Laravel-Excel 3.1 csv import Date column not converting

I was trying to import csv file using Laravel-Excel 3.1. In the csv file have a date column and it's format is 'dd/mm/yy', example - "24/07/20". I am using ToModel method. How can I save intu the database in format of "yyyy/mm/dd", exaple -…
Pallab
  • 145
  • 1
  • 9
0
votes
1 answer

How to format dates in Laravel Excel?

I want to ask, how can we validate dates from Excel file. I have encountered some weird test cases below. Firstly, I have inputted 5/13/2021 in my excel file, but when I dump in, it doesn't display same, instead it displays 44329. But fortunately I…
schutte
  • 1,949
  • 7
  • 25
  • 45
0
votes
0 answers

Laravel-Excel: How to open an xls, set some input cells and read the result cell in PHP?

I'm working with Laravel and I installed Laravel-Excel package. How can I set some cells and read the results of some formulas from other cell? Is that possible with this package/plain php? I'm ready to switch to Phpspreadsheet too. Thanks in…
Ponzio Pilato
  • 315
  • 1
  • 5
  • 18
0
votes
1 answer

How to validate multiple sheets in Laravel excel?

I have figure it out how to validate one sheet in Laravel Excel. But I don't know how to differentiate validation by each sheet? Someone knows how to do it? I have these validations for my sheet-1 return [ "*.0" => ['required', 'integer'], …
schutte
  • 1,949
  • 7
  • 25
  • 45
0
votes
0 answers

Reading Excel File From Remote Path - PHP Laravel

I have a csv file from a remote path in a response as below . I am trying to read the columns on the excel file but i get the error file not found at path: 501149794557447800.csv . What could i be missing here ? Response 'payload' => array ( …
0
votes
2 answers

How to fix strange "Undefined offset"? (laravel)

I have these codes below, it always return undefined offset error. I get the data value using dd it has value in index 1. array:3 [▼ 0 => "Title 1" 1 => "Content1" 2 => "Subcontent1" ] But when I run error returned: Undefined offset: 1 My…
0
votes
2 answers

laravel Rule::exists by connection and column

I am using the Laravel Excel package to import data from an Excel spreadsheet file. During the importing, I need to verify that some column values exist in an external database table at a specific column. The external model Catalog.php looks…
Pathros
  • 10,042
  • 20
  • 90
  • 156
0
votes
3 answers

PHP trim returns string, trim on a double?

I am using Laravel Excel to upload an excel file. Using a foreach loop on the rows of data I am trimming whitespace and returning them as $row[$k] = trim($v); However, Excel stores dates as a number - which is of type double. This caused many…
JamesG
  • 1,552
  • 8
  • 39
  • 86
0
votes
1 answer

Laravel-Excel export relationship data

I am trying to export records to a CSV which queries a relation but my file keeps returning nothing but the headings. I am making use of the laravel-excel package to do this. Controller Method public function export(Team $team) { return…
Lowtiercoder
  • 153
  • 4
  • 12
0
votes
0 answers

Not showing mesage when validating excel file in laravel import

I am using excel 3.1 in Laravel for importing excel files. I have included a validation for the name field. So whenever the name field is duplicating it will not import that row data to DB. everything works fine up to here. but the problem is I want…
rkv
  • 1
  • 3
0
votes
1 answer

Laravel excel importing csv configs for this csv data structure?

I'm trying to import csv file using Laravel-excel composer package, but that csv file inside deferent that usual csv files, then I found by changing config of default Laravel-excel package can make it import. but i cannot identified what is the…
vidur
  • 93
  • 1
  • 7
0
votes
0 answers

incorrect table name inserting into using Laravel Excel to Collection

I'm attemptng to insert relational data using the Laravel Excel concern ToCollection use Maatwebsite\Excel\Concerns\ToCollection; however the query is attempting to insert into the table objective_years and not…
cinameng
  • 313
  • 4
  • 14
0
votes
1 answer

Setting up Laravel-excel and PhpSpreadsheet macro

I am using Maatwebsite Laravel-excel version 3.1. And I want to set the default styling of the sheet. I have read the documentation about including a macro in your laravel app by setting this in my AppServiceProvider boot() method.…
Jan Michael
  • 110
  • 11
0
votes
0 answers

Malformed UTF-8 characters, possibly incorrectly encoded with Guzzle/Http

I have an API created for export records in xlsx. It is working fine when I call the API directly but if I am using Guzzle/Http to call the API and this was tested using Postman, I get the following error: "message": "Malformed UTF-8 characters,…
doremi666
  • 121
  • 3
  • 15