i try the answer to this about bulk insert in laravel Query builder. my query output is
[
{"name":"Dayle","id":1,"email":"dayle213@gmail.com"},
{"name":"John","id":2,"email":"john.doe@gmail.com"}
]
but when i try
DB::table('staff')->insert($data);
i get error Query\Builder::insert() must be of the type array, object given,
when i try
DB::table('staff')->insert($data->toArray());
i get error Object of class stdClass could not be converted to string.
how can i insert inn bulk ?