public function resource($slice = -2)
    {
        $segments = explode('/', trim(app('request')->getUri(), '/'));

        if ($slice != 0) {
            $segments = array_slice($segments, 0, $slice);
        }

        return implode('/', $segments);
    }
public function resource($slice = -2)
    {
        $segments = explode('/', trim(app('request')->getUri(), '/'));

        if ($slice != 0) {
            $segments = array_slice($segments, 0, $slice);
        }

        return implode('/', $segments);
    }
public function resource ( $ slice = - 2 ) { $ segments = explode ( '/' , trim ( app ( 'request' ) -> getUri ( ) , '/' ) ) ; if ( $ slice != 0 ) { $ segments = array_slice ( $ segments , 0 , $ slice ) ; } return implode ( '/' , $ segments ) ; }
Get current resource route url.

@param int $slice

@return string
Get current resource route url .