Support the ongoing development of Laravel.io →
Input Database
Last updated 2 years ago.
0
User::insert(array(
    array(
        'name' => 'a',
        'age' => 1
    ),
    array(
        'name' => 'b',
        'age' => 2
    ),
    array(
        'name' => 'c',
        'age' => 3
    ),
    array(
        'name' => 'd',
        'age' => 4
    )
));

Your arrays must containe data for a single record, not a row.

Last updated 2 years ago.
0

okursan said:

User::insert(array(
   array(
       'name' => 'a',
       'age' => 1
   ),
   array(
       'name' => 'b',
       'age' => 2
   ),
   array(
       'name' => 'c',
       'age' => 3
   ),
   array(
       'name' => 'd',
       'age' => 4
   )
));

Your arrays must containe data for a single record, not a row.

There is no "insert" for Eloquent Model. You're WRONG!

0

tucq88 said:

okursan said:

User::insert(array(
   array(
       'name' => 'a',
       'age' => 1
   ),
   array(
       'name' => 'b',
       'age' => 2
   ),
   array(
       'name' => 'c',
       'age' => 3
   ),
   array(
       'name' => 'd',
       'age' => 4
   )
));

Your arrays must containe data for a single record, not a row.

There is no "insert" for Eloquent Model. You're WRONG!

There certainly is a insert method for the eloquent model.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

reeouw reeouw Joined 1 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.