laravel excel version 3.1 laravel version 5.6 i have over 100000 rows of data in excel file. I would like to import this data into my database.
In My controller.php
if(request()->file('fertilizer_import')) {
$import = new FertilizerImport();
$file = request()->file('fertilizer_import');
dispatch(new FertilizerImportJob($import, $file));
}
In my FertilizerImportJob.php
public function __construct($import, $file)
{
$this->import = $import;
$this->file = $file;
}
public function handle()
{
Excel::import($this->import, $this->file);
}
And then, I uploaded my excel file. It is enter one row in jobs table. I run php artisan make:queue but data is not enter my fertilizer table.
How can i do that? Please advice me.
$filefirst, but expecting$fileto be the second parameter in the constructor?QUEUE_DRIVER=database.