1public function __construct(){
2 $this->middleware(function ($request, $next) {
3 if(auth()->user()->hasRole('frontuser')){
4 return redirect()->route('home')->withFlashMessage('You are not authorized to access that page.')->withFlashType('warning');
5 }
6 return $next($request);
7 });
8}
9