Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

save many records with seeder in laravel 8

$insertMany = Pricing::create(['name'=>request('name')]);
$insertMany->available()->createMany([
      ['service_id'=>1],
      ['service_id'=>2],
      ['service_id'=>3],
      ['service_id'=>4],
      ['service_id'=>5],
]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #save #records #seeder #laravel
ADD COMMENT
Topic
Name
1+2 =