Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel 8 insert multiple rows

$array = [
     ['value' => "value1", 'status_id' => 1],
     ['value' => "value2", 'status_id' => 2]
];

ModelName::insert($array);
// or
DB::table('table_name')->insert($array);
 
PREVIOUS NEXT
Tagged: #laravel #insert #multiple #rows
ADD COMMENT
Topic
Name
2+7 =