I'm using following package to import large CSV file to MySQL database:
https://github.com/Maatwebsite/Laravel-Excel
Here is my controller code:
Excel::filter('chunk')->load($file)->chunk(250, function($results) use ($count)
{
++$count;
echo "<br/> Count = " . $count;
foreach($results as $row)
{
// do stuff
}
Here is line from composer.json
"maatwebsite/excel": "~2.1.0"
Here is my config/app.php file:
'providers' => [
....
....
Maatwebsite\Excel\ExcelServiceProvider::class,
],
'aliases' => [
....
....
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
]
I am getting this error and I cannot find any solution:
InvalidArgumentException in Dispatcher.php line 333:
No handler registered for command [Maatwebsite\Excel\Readers\ChunkedReadJob]
I tried following link for solution but no luck: