getRequestUri(), $exclude_uri) && !in_array($request->getRequestUri(), $includeUri)) { return $next($request); } if (Auth::user() === null) { return $next($request); } if ($request->isMethod('get')) { return $next($request); } //In APP Demo User should not be allowed to access but in panel demo off user should be allowed to access if (Auth::user()->mobile != "9876598765" && Auth::user()->hasRole('User')) { return $next($request); } if (Auth::user()->email == "demooff@gmail.com" && Auth::user()->hasRole('Super Admin')) { return $next($request); } if ($request->is('api/*') || $request->ajax()) { return response()->json(array( 'error' => true, 'message' => "This is not allowed in the Demo Version.", 'code' => 112 )); } return redirect()->back()->withErrors([ 'message' => "This is not allowed in the Demo Version" ]); } }