Read the Xlsx file in laravel easy with the array object
composer require rajwebsoft/xlsreader
Add the code in config/app.php
'providers' => [
....
Rajwebsoft\Xlsreader\XlsreaderServiceProvider::class,
]
use Rajwebsoft\Xlsreader\Xlsreader;
$objdata =new Xlsreader();
$xlsobj = $objdata->readFile("itf_example.xlxs");
$sheetNames = $xlsobj->getSheetNames();
$sheetdata=$xlsobj->getSheetData($sheetNames[1]);
$requestcontact = $xlsobj->getDataObject($sheetdata);
[{
"name"=>"raj Kumar",
"phone"=>"9090909090",
},
{
"name"=>"rahul Kumar",
"phone"=>"8787878788",
}]
Now you can enjoy the package and your suggetion is welcome for any issue