Answers for "eloquent batch insert"

PHP
1

insert batch in laravel

$data = [
  ['name' => 'John', 'age' => 25],
  ['name' => 'Maria', 'age' => 31],
  ['name' => 'Julia', 'age' => 55],
];
DB::table('table_name')->insert($data);
Posted by: Guest on July-31-2020
0

eloquent batch insert

$data = array(
    array('name'=>'Coder 1', 'rep'=>'4096'),
    array('name'=>'Coder 2', 'rep'=>'2048'),
    //...
);

Coder::insert($data);
Posted by: Guest on December-11-2020
0

insert batch in laravel

$data = array(
    array('name'=>'Coder 1', 'rep'=>'4096'),
    array('name'=>'Coder 2', 'rep'=>'2048'),
    //...
);

Coder::insert($data);
Posted by: Guest on July-31-2020
0

laravel eloquent batch insert

$data = [
    ['name' => 'John', 'age' => 25],
    ['name' => 'Maria', 'age' => 31],
    ['name' => 'Julia', 'age' => 55],
];

Model::insert($data);
Posted by: Guest on July-14-2021

Browse Popular Code Answers by Language