Laravel 5.2 User Settings
Please can help me to add User Settings, specialy change password in laravel 5.2 ??
Hey Mochinbn-bounouara,
Do you already have a form where the user can update their settings.
I know one easy way you can do this is to set the password to only reset if it has changed. So, in your function you would do something like the following:
<?php
<p>public function update($request, $id){
// Perform your validation</p>
<pre><code>$user = User::find($id);
if ($request->password == '') {
$request->password = $user->password;
} else {
$request->password = Hash::make($request->password);
}
$user->update($request);
// return back to route letting user know that they have successfully updated their account.
}
Let me know if that helps or if you need further assistance :)