isMobile()) { return view(config("detector.mobilePath") . "." . $viewName, $args); } else if(Auth()->user() !== null) { if (Auth()->user()->can('admin.panel.show') == true) return view(config("detector.defaultPath") . "." . $viewName, $args); } if($viewName == "users.login" || $viewName == "users.logout") return view(config("detector.mobilePath") . "." . $viewName, $args); return view("errors.403", $args); } }