original_string: public function resource($slice = -2)
      {
          $segments = explode('/', trim(app('request')->getUri(), '/'));
  
          if ($slice != 0) {
              $segments = array_slice($segments, 0, $slice);
          }
  
          return implode('/', $segments);
      }
code: public function resource($slice = -2)
      {
          $segments = explode('/', trim(app('request')->getUri(), '/'));
  
          if ($slice != 0) {
              $segments = array_slice($segments, 0, $slice);
          }
  
          return implode('/', $segments);
      }
code_tokens: public function resource ( $ slice = - 2 ) { $ segments = explode ( '/' , trim ( app ( 'request' ) -> getUri ( ) , '/' ) ) ; if ( $ slice != 0 ) { $ segments = array_slice ( $ segments , 0 , $ slice ) ; } return implode ( '/' , $ segments ) ; }
docstring: Get current resource route url.
  
  @param int $slice
  
  @return string
docstring_tokens: Get current resource route url .