Permalink
Browse files

add send reset password email button to clients view/edit page, fix s…

…ome minor bootstrap 4 mishaps.
  • Loading branch information...
Nadja Schnabel
Nadja Schnabel committed Feb 12, 2018
1 parent f29ad69 commit e3537dd77cdff9c215a2926b0444939e27364573
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Admin;
use Password;
use App\Models\Role;
use App\User;
use Illuminate\Validation\Rule;
@@ -95,4 +96,30 @@ public function destroy($user)
return redirect_to_resource();
}
/**
* Send a reset link to the given user.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function sendResetLinkEmail(Request $request)
{
$this->validate($request, ['email' => 'required|email']);
//We will send the password reset link to this user. Once we have attempted
//to send the link, we will examine the response then see the message we
//need to show to the user. Finally, we'll send out a proper response.
$response = Password::broker()->sendResetLink($request->only('email'));
if($response == 'passwords.sent'){
notify()->success('Success!', 'Password email sent to client.');
}else {
notify()->error('Oops', 'Something went wrong', 'warning shake animated');
}
return redirect()->back();
}
}
Oops, something went wrong.

0 comments on commit e3537dd

Please sign in to comment.