jeudi 15 octobre 2015

DB::table Vs Eloquent Model - Laravel Database Seed

When researching for Database Seeder, it's common to see people using DB::table('my_table')->insert(['column' => 'value']) in the Seeder classes. I'd like to know the reasoning behind this apparent convention as to why I should use DB::* instead of MyModel::* to perform such tasks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire