use middleware in controller to have access session

Solutions on MaxInterview for use middleware in controller to have access session by the best coders in the world

showing results for - "use middleware in controller to have access session"
Agustina
14 Jan 2020
1$this->middleware(function($request,$next){
2  if (session('success')) {
3  	Alert::success(session('success'));
4  }
5
6  if (session('error')) {
7  	Alert::success(session('error'));
8  }
9
10  return $next($request);
11});