How to get each cell from PHPExcel Laravel result?
I'm importing excel file with Laravel PHPExcel, it works fine, but I need to get just the first cell of each row which is telephone column, this is my code,
public function importar()
{
$path = 'public/excel/excelinvitaciones.xlsx';
Excel::filter('chunk')->load($path)->chunk(250, function($results)
{
$invitacion = new PuertoInvitacion();
for ($i=0; $i <= count($results); $i++)
{
$arrayInvitacion = ["idpuerto" => "1" , "telefono" => $results[$i][0]];
$invitacion->crearNueva($arrayInvitacion);
}
});
}
the Excel file looks like this
A1
416723123
414123723
412123123
It's just saving [414123723]
id idpuerto telefono
1 1 [414123723]
I'm new at this, I can't understand how I have to handle $results to get just that cell information, thank you.