I am using Maatwebsite/Laravel-Excel to import a csv. The csv file looks like:
id;parent;name
1;0;Home
2;0;Contact
3;2;Thank you
4;0;Blog
5;4;Article 1
6;4;Article 2
The code is:
$rows = Excel::load('file.csv')->get();
$rows->each(function($row) {
dd($row->toArray());
});
The output is like:
array:3 [
"id" => 1.0
"parent" => 0.0
"name" => "Home"
]
So the regular numbers have a decimal added to it. How do I make it a regular integer without decimals?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire