Simply because you are updating an existing user.
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.
The common way to update a model is
$user = User::find($id);
$user->whatever = $whatever
$user->save();
pmall said:
The common way to update a model is
$user = User::find($id); $user->whatever = $whatever $user->save();
Perfect, thanks :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community