original_string: public function setRoute(string $route = null, array $params = []): ButtonInterface
      {
          if ($this->isVisibility()) {
              if ($route === null) {
                  $url = '#';
              } else {
                  $url = '#';
                  if (app('router')->has($route)) {
                      $url = route($route, $params);
                  } else {
                      $this->setVisible(false);
                  }
              }
              $this->setUrl($url);
          }
  
          return $this;
      }
code: public function setRoute(string $route = null, array $params = []): ButtonInterface
      {
          if ($this->isVisibility()) {
              if ($route === null) {
                  $url = '#';
              } else {
                  $url = '#';
                  if (app('router')->has($route)) {
                      $url = route($route, $params);
                  } else {
                      $this->setVisible(false);
                  }
              }
              $this->setUrl($url);
          }
  
          return $this;
      }
code_tokens: public function setRoute ( string $ route = null , array $ params = [ ] ) : ButtonInterface { if ( $ this -> isVisibility ( ) ) { if ( $ route === null ) { $ url = '#' ; } else { $ url = '#' ; if ( app ( 'router' ) -> has ( $ route ) ) { $ url = route ( $ route , $ params ) ; } else { $ this -> setVisible ( false ) ; } } $ this -> setUrl ( $ url ) ; } return $ this ; }
docstring: If not found route, the button is not visible automatically
  
  @param string|null $route
  @param array       $params
  
  @return ButtonInterface
docstring_tokens: If not found route the button is not visible automatically