public function resource($path = null)
    {
        if (!empty($path)) {
            $this->resourcePath = $path;

            return $this;
        }

        if (!empty($this->resourcePath)) {
            return $this->resourcePath;
        }

        return app('request')->getPathInfo();
    }
public function resource($path = null)
    {
        if (!empty($path)) {
            $this->resourcePath = $path;

            return $this;
        }

        if (!empty($this->resourcePath)) {
            return $this->resourcePath;
        }

        return app('request')->getPathInfo();
    }
public function resource ( $ path = null ) { if ( ! empty ( $ path ) ) { $ this -> resourcePath = $ path ; return $ this ; } if ( ! empty ( $ this -> resourcePath ) ) { return $ this -> resourcePath ; } return app ( 'request' ) -> getPathInfo ( ) ; }
Get current resource uri.

@param string $path

@return string
Get current resource uri .