where('is_active', true)->first(); $authenticated = $sessionKey && $appSession && $appSession->pro && $appSession->pro->pro_type == 'ADMIN'; if (!$authenticated) { //return redirect('/'); return abort(403); } return $next($request); } }