src/Relationship.php
public function toArray()
    {
        $array = [];

        if (! empty($this->data)) {
            $array['data'] = $this->data->toIdentifier();
        }

        if (! empty($this->meta)) {
            $array['meta'] = $this->meta;
        }

        if (! empty($this->links)) {
            $array['links'] = $this->links;
        }

        return $array;
    }
public function toArray()
    {
        $array = [];

        if (! empty($this->data)) {
            $array['data'] = $this->data->toIdentifier();
        }

        if (! empty($this->meta)) {
            $array['meta'] = $this->meta;
        }

        if (! empty($this->links)) {
            $array['links'] = $this->links;
        }

        return $array;
    }
public function toArray ( ) { $ array = [ ] ; if ( ! empty ( $ this -> data ) ) { $ array [ 'data' ] = $ this -> data -> toIdentifier ( ) ; } if ( ! empty ( $ this -> meta ) ) { $ array [ 'meta' ] = $ this -> meta ; } if ( ! empty ( $ this -> links ) ) { $ array [ 'links' ] = $ this -> links ; } return $ array ; }
Map everything to an array.

@return array
Map everything to an array .