Support the ongoing development of Laravel.io →
Eloquent Database
Last updated 1 year ago.
0

Myclass::insert() does not exists on eloquent. I may be wrong though

0

so insert may be from direct DB query builder. I did not find any clear documentation on this. That is the reason i posted it here.

0

I think so yes. From official docs:

App\Flight::create(['name' => 'Flight 10']);

is for mass assignment on Eloquent class

DB::table('users')->insert(['email' => '[email protected]', 'votes' => 0]);

is used with query builder

0

Thanks Mate. Atleast i can show this to my team :)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.