original_string: protected function checkScope($update = true)
      {
          $request = request();
  
          if ($update && $request->exists('scope')) {
  
              $this->activeScope = $request->get('scope');
  
              $this->markResetActivePage();
              $this->storeActiveScopeInSession();
          } else {
              $this->retrieveActiveScopeFromSession();
          }
  
          // Check if active is valid, reset it othwerwise
          if ($this->activeScope && ! $this->isValidScopeKey($this->activeScope)) {
              $this->activeScope = null;
              $this->storeActiveScopeInSession();
          }
  
          return $this;
      }
code: protected function checkScope($update = true)
      {
          $request = request();
  
          if ($update && $request->exists('scope')) {
  
              $this->activeScope = $request->get('scope');
  
              $this->markResetActivePage();
              $this->storeActiveScopeInSession();
          } else {
              $this->retrieveActiveScopeFromSession();
          }
  
          // Check if active is valid, reset it othwerwise
          if ($this->activeScope && ! $this->isValidScopeKey($this->activeScope)) {
              $this->activeScope = null;
              $this->storeActiveScopeInSession();
          }
  
          return $this;
      }
code_tokens: protected function checkScope ( $ update = true ) { $ request = request ( ) ; if ( $ update && $ request -> exists ( 'scope' ) ) { $ this -> activeScope = $ request -> get ( 'scope' ) ; $ this -> markResetActivePage ( ) ; $ this -> storeActiveScopeInSession ( ) ; } else { $ this -> retrieveActiveScopeFromSession ( ) ; } // Check if active is valid, reset it othwerwise if ( $ this -> activeScope && ! $ this -> isValidScopeKey ( $ this -> activeScope ) ) { $ this -> activeScope = null ; $ this -> storeActiveScopeInSession ( ) ; } return $ this ; }
docstring: Checks for the active scope.
  
  @param bool $update
  @return $this
docstring_tokens: Checks for the active scope .