Support the ongoing development of Laravel.io →
Database Forms Queues
Last updated 2 years ago.
0

Simply because you are updating an existing user.

Last updated 2 years ago.
0

Then it is the only way?? : User::where()->update()

Seen documentation :

$user = User::find(1); $user->email = '[email protected]'; $user->save();

Here is updated an existing user.

Thanks.

Last updated 2 years ago.
0
Solution

The common way to update a model is

$user = User::find($id);
$user->whatever = $whatever
$user->save();
Last updated 2 years ago.
0

pmall said:

The common way to update a model is

$user = User::find($id);
$user->whatever = $whatever
$user->save();

Perfect, thanks :)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

cuviline cuviline Joined 16 Jul 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.