0
私はLaravel 5.4キューを使用しています。私はExcelを読んで、数秒後にそのレコードのDBエントリを作成したいと思います。Laravel 5.4のキューで関数を渡す方法は?
$queue = Queue::later(10,'LogMsg', app('App\Http\Controllers\getFileController')->myfunc($name));
return $queue;
これは私の呼び出し関数です。まずこれを渡すことができますか?
public function myfunc($name) {
$f_data = Excel::load('public/invoices/'.$name, function($reader) {
})->get();
if(!empty($f_data) && $f_data->count()){
foreach ($f_data as $key => $row){
$inv = new final_tables;
foreach ($row as $key1 => $col){
$inv->$key1 = $row->$key1;
}
$inv->save();
}
}
return 'done';
}