public function pointerForRelationship(string $key, string $default = '/'): string
    {
        $field = collect(explode('.', $key))->first();

        if (!$this->isRelationship($field)) {
            throw new \InvalidArgumentException("Field {$field} is not a relationship.");
        }

        $pointer = $this->pointer($key);

        return Str::after($pointer, "relationships/{$field}") ?: $default;
    }
public function pointerForRelationship(string $key, string $default = '/'): string
    {
        $field = collect(explode('.', $key))->first();

        if (!$this->isRelationship($field)) {
            throw new \InvalidArgumentException("Field {$field} is not a relationship.");
        }

        $pointer = $this->pointer($key);

        return Str::after($pointer, "relationships/{$field}") ?: $default;
    }
public function pointerForRelationship ( string $ key , string $ default = '/' ) : string { $ field = collect ( explode ( '.' , $ key ) ) -> first ( ) ; if ( ! $ this -> isRelationship ( $ field ) ) { throw new \ InvalidArgumentException ( "Field {$field} is not a relationship." ) ; } $ pointer = $ this -> pointer ( $ key ) ; return Str :: after ( $ pointer , "relationships/{$field}" ) ? : $ default ; }
Convert a validation key to a JSON pointer for a relationship object within the resource.

@param string $key
@param string $default
@return string
Convert a validation key to a JSON pointer for a relationship object within the resource .