I'm trying to add a Session success message when a User login.
I've tried adding the following to the AuthenticatesUsers.php trait postLogin():
if (Auth::attempt($credentials, $request->has('remember'))) {
return $this->handleUserWasAuthenticated($request, $throttles)->withSuccess("message");
}
I've also tried adding to the handleUserWasAuthenticated():
return redirect()->intended($this->redirectPath())->withSuccess("message");
I run composer dump-autoload after each change but it just will not flash the message in the view. I use a partial called success.blade.php and the contents are:
@if (Session::has('success'))
<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>
<i class="fa fa-check-circle fa-lg fa-fw"></i> Success.
</strong>
{{ Session::get('success') }}
</div>
@endif
I think I'm missing something but I can't think what at the moment so hoping for a fresh set of eyes.
Thank you in advance.