Answer the question
In order to leave comments, you need to log in
Update password but not always?
There is a moment in the code when you need to update the user, but update the password only when it is entered.
$data = [..];
if ($request->password){
$data['password'] = bcrypt($request->password);
}
$user->update($data);
Answer the question
In order to leave comments, you need to log in
You use FormRequest and after:
And the password of a stall itself will encrypt. Or if not, then you make a mutator in the model.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question