mavinoo / laravelBatch

insert batch and update batch in laravel
MIT License
572 stars 118 forks source link

Too few arguments to function #15

Closed Evhanz closed 5 years ago

Evhanz commented 5 years ago

screenshot_20190221_184032

Sorry guys, but I have a big problem, in the last update I found this error in all the code that I used with its amazing package, I would love to fix it as fast as possible, help me please.

in my Code :

$columns = [ 'a', 'b', 'c', ]; $batch = new Batch $batch->insert('polls_schedulers_areas', $columns, $data, 200);

mavinoo commented 5 years ago

hi @Evhanz use table model instead of table name https://github.com/mavinoo/laravelBatch/pull/14

mavinoo commented 5 years ago

#version dev-master

At last commit You send the model instead of the table name.

use Batch;
use App\Models\PollsSchedulersAreas;

$model = new PollsSchedulersAreas;

$columns = [
   'a',
   'b',
   'c'
];

$data = [
   ['a1', 'b1', 'c1'],
   ['a2', 'b2', 'c3'],
];
Batch::insert($model, $columns, $data, 200);

#version 2.0

or install version 2.0 laravel-batch

composer require mavinoo/laravel-batch:2.0

and using

$batch->insert('polls_schedulers_areas', $columns, $data, 200);
Evhanz commented 5 years ago

Sorry for not answering, but version 2.0 worked for how the project was already done, but we will see if we move to the latest version, excellent work thanks