original_string: public function showResource($name)
      {
          $options = Config::get('laravel-swagger::getResourceOptions');
          $resourceName = "/" . str_replace("-", "/", $name);
  
          $excludedPath = Config::get('laravel-swagger::excludedPath');
          $swagger = new Swagger($this->getPaths(), $excludedPath);
  
          if (Config::get('laravel-swagger::cache') && Cache::has('resource_'.$resourceName)) {
              $resource = Cache::get('resource_'.$resourceName);
          } else {
              if (!in_array($resourceName, $swagger->getResourceNames())) {
                  App::abort(404, 'Resource not found');
              }
  
              // Pet demo uses the main laravel-swagger route.
              if ($resourceName == '/petdemo') {
                  $options['defaultBasePath'] = route('swagger-index');
              }
  
              $resource = $swagger->getResource($resourceName, $options);
          }
  
          if (Config::get('laravel-swagger::cache') && !Cache::has('resource_'.$resourceName)) {
              Cache::put('resource_'.$resourceName, $resource, $this->getExpireAt());
          }
  
          return $resource;
      }
code: public function showResource($name)
      {
          $options = Config::get('laravel-swagger::getResourceOptions');
          $resourceName = "/" . str_replace("-", "/", $name);
  
          $excludedPath = Config::get('laravel-swagger::excludedPath');
          $swagger = new Swagger($this->getPaths(), $excludedPath);
  
          if (Config::get('laravel-swagger::cache') && Cache::has('resource_'.$resourceName)) {
              $resource = Cache::get('resource_'.$resourceName);
          } else {
              if (!in_array($resourceName, $swagger->getResourceNames())) {
                  App::abort(404, 'Resource not found');
              }
  
              // Pet demo uses the main laravel-swagger route.
              if ($resourceName == '/petdemo') {
                  $options['defaultBasePath'] = route('swagger-index');
              }
  
              $resource = $swagger->getResource($resourceName, $options);
          }
  
          if (Config::get('laravel-swagger::cache') && !Cache::has('resource_'.$resourceName)) {
              Cache::put('resource_'.$resourceName, $resource, $this->getExpireAt());
          }
  
          return $resource;
      }
code_tokens: public function showResource ( $ name ) { $ options = Config :: get ( 'laravel-swagger::getResourceOptions' ) ; $ resourceName = "/" . str_replace ( "-" , "/" , $ name ) ; $ excludedPath = Config :: get ( 'laravel-swagger::excludedPath' ) ; $ swagger = new Swagger ( $ this -> getPaths ( ) , $ excludedPath ) ; if ( Config :: get ( 'laravel-swagger::cache' ) && Cache :: has ( 'resource_' . $ resourceName ) ) { $ resource = Cache :: get ( 'resource_' . $ resourceName ) ; } else { if ( ! in_array ( $ resourceName , $ swagger -> getResourceNames ( ) ) ) { App :: abort ( 404 , 'Resource not found' ) ; } // Pet demo uses the main laravel-swagger route. if ( $ resourceName == '/petdemo' ) { $ options [ 'defaultBasePath' ] = route ( 'swagger-index' ) ; } $ resource = $ swagger -> getResource ( $ resourceName , $ options ) ; } if ( Config :: get ( 'laravel-swagger::cache' ) && ! Cache :: has ( 'resource_' . $ resourceName ) ) { Cache :: put ( 'resource_' . $ resourceName , $ resource , $ this -> getExpireAt ( ) ) ; } return $ resource ; }
docstring: Show an specific Resource
docstring_tokens: Show an specific Resource