Search
 
SCRIPT & CODE EXAMPLE
 

PHP

insert batch in laravel

$data = [
  ['name' => 'John', 'age' => 25],
  ['name' => 'Maria', 'age' => 31],
  ['name' => 'Julia', 'age' => 55],
];
DB::table('table_name')->insert($data);
Comment

insert batch in laravel

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

Coder::insert($data);
Comment

PREVIOUS NEXT
Code Example
Php :: check the route type in laravel 
Php :: random string value laravel 
Php :: php regex replace to remove special characters and accented 
Php :: create array php 
Php :: laravel response json status 500 
Php :: how to give optional parameter in route 
Php :: php input time validation 
Php :: maatwebsite/excel package 5.2 laravel 
Php :: run codeigniter 4 with spark 
Php :: get joomla group ids 
Php :: filter var php function 
Php :: add brackets to string php 
Php :: Uncaught ReferenceError: commonL10n is not defined 
Php :: read xml file in php wordpress 
Php :: status messages wordpress settings form 
Php :: parse json nested array form url in php 
Php :: pdo connection 
Php :: php webpage to string 
Php :: php difference between two dates in seconds 
Php :: calculate array length in php 
Php :: Change date format on view - laravel 
Php :: lenght de un array php 
Php :: php slice array in half 
Php :: php function to remove 0 value from array 
Php :: php multiplication 
Php :: delay in php 
Php :: php trim 
Php :: laravel date diff 
Php :: remove all items of an array except the last 5 in php 
Php :: how to create foreign key in laravel 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =