I need to make a DB inert which looks like this:
DB::table('users')->insert([
['email' => '[email protected]', 'votes' => 0],
['email' => '[email protected]', 'votes' => 0]
]);
But I am tryint to build the data with dynamic values eg in a loop add more times:
array_push($a,'email' => $this->mail,'votes' => $this->votes);
So that I can simply run this later:
DB::table('users')->insert($myData);
So how can I push a dimensional array?