original_string: private function callController()
      {
          $name = $this->getResourceControllerName();
  
          if ($this->confirm("Create a controller ($name) for the $this->resource resource?")) {
              $arg = $this->getArgumentResource();
              $name = substr_replace($arg, str_plural($this->resource),
                  strrpos($arg, $this->resource), strlen($this->resource));
  
              if ($this->repositoryContract) {
                  $this->callCommandFile('controller', $name, 'controller_repository');
              }
              else {
                  // if admin - update stub
                  if (!str_contains($name, 'admin.')) {
                      $this->callCommandFile('controller', $name, 'controller');
                  }
                  else {
                      $this->callCommandFile('controller', $name, 'controller_admin');
                  }
              }
          }
      }
code: private function callController()
      {
          $name = $this->getResourceControllerName();
  
          if ($this->confirm("Create a controller ($name) for the $this->resource resource?")) {
              $arg = $this->getArgumentResource();
              $name = substr_replace($arg, str_plural($this->resource),
                  strrpos($arg, $this->resource), strlen($this->resource));
  
              if ($this->repositoryContract) {
                  $this->callCommandFile('controller', $name, 'controller_repository');
              }
              else {
                  // if admin - update stub
                  if (!str_contains($name, 'admin.')) {
                      $this->callCommandFile('controller', $name, 'controller');
                  }
                  else {
                      $this->callCommandFile('controller', $name, 'controller_admin');
                  }
              }
          }
      }
code_tokens: private function callController ( ) { $ name = $ this -> getResourceControllerName ( ) ; if ( $ this -> confirm ( "Create a controller ($name) for the $this->resource resource?" ) ) { $ arg = $ this -> getArgumentResource ( ) ; $ name = substr_replace ( $ arg , str_plural ( $ this -> resource ) , strrpos ( $ arg , $ this -> resource ) , strlen ( $ this -> resource ) ) ; if ( $ this -> repositoryContract ) { $ this -> callCommandFile ( 'controller' , $ name , 'controller_repository' ) ; } else { // if admin - update stub if ( ! str_contains ( $ name , 'admin.' ) ) { $ this -> callCommandFile ( 'controller' , $ name , 'controller' ) ; } else { $ this -> callCommandFile ( 'controller' , $ name , 'controller_admin' ) ; } } } }
docstring: Generate the resource controller
docstring_tokens: Generate the resource controller