Laravel-excel: How to use slugged with count in 3.1

Created on 10 Oct 2018  路  8Comments  路  Source: Maatwebsite/Laravel-Excel


[QUESTION]

Versions

  • PHP version: 7.2
  • Laravel version: 5.7
  • Package version: 3.1

Description

How can make headings sluggedwithcount i saw that version 2 has that kind of feature? should i just install version 2?

Steps to Reproduce

import file with headers should have 2 or more headers with the same name

Most helpful comment

By not using the WithHeadingRow concern, but using the WithStartRow concern, so you can skip the first row. (https://laravel-excel.maatwebsite.nl/3.1/imports/concerns.html#import-concerns)

All 8 comments

You can implement it in any way you want with a custom formatter: https://laravel-excel.maatwebsite.nl/3.1/imports/heading-row.html#custom-formatter

how do i manage headers with the same name?

In your situation it's perhaps better to not use the heading row as array keys, you can also just use the numeric index instead.

then i'll change my question to how do i ignore the header row in importing the file

By not using the WithHeadingRow concern, but using the WithStartRow concern, so you can skip the first row. (https://laravel-excel.maatwebsite.nl/3.1/imports/concerns.html#import-concerns)

ohh nice thank you

i want to skip a key or column in header row ? i can it possible

i want to skip a key or column in header row ? i can it possible

Just define the names of the columns that you'd like to include? See documentation about heading row. Using keys is covered in the Importing basics.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gamevnlc picture gamevnlc  路  3Comments

muhghazaliakbar picture muhghazaliakbar  路  3Comments

contifico picture contifico  路  3Comments

lucatamtam picture lucatamtam  路  3Comments

amine8ghandi8amine picture amine8ghandi8amine  路  3Comments