dimanche 1 novembre 2015

Laravel - 2 queries over nothing?

Hello guys,

in the official doc of Eloquent for Laravel, this is the way to make an update to a table :

$flight = App\Flight::find(1);
$flight->name = 'New Flight Name';
$flight->save();

I must say, I don't really understand that. For me, it means that for a very basic update, there will be 2 queries to the database - a select and THEN an update ?

Anyone could explain me why this would be a good solution ?

Thanks !



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire