app/Http/Controllers/Auth/LoginController.php
In my app folder I have a LoginController which I override the logout function to add a session flash:
public function logout(Request $request)
{
$this->guard()->logout();
$request->session()->flush();
$request->session()->regenerate();
$request->session()->flash('status', 'Task was successful!');
error_log('~~~~~~~~~~~~~~~~~~~~~');
error_log($request->session()->get('status'));
error_log('~~~~~~~~~~~~~~~~~~~~~');
return redirect('/');
}
My error log works here, but when I actually get redirected it goes to routes/web.php line:
Route::get('/', 'HomeController@index');
But at this point the session no longer seems to exist. My end goal was to display it on my login page that the user has successfully logged out. I have a feeling my logic is flawed and it's being erased via the routes file, but I know at some point I am indeed writing to the session. Any Advice?
return redirect('/')->withStatus('Task was sucessful!');- manix