protected function extractRelationshipAttributes($columnName, array $attributes)
    {
        $attributes = filter_array_keys($attributes, function ($key) use ($columnName) {
            return starts_with($key, $columnName . '.');
        });

        $extractedAttributes = [];

        foreach ($attributes as $key => $value) {
            $key = substr($key, strlen($columnName) + 1);
            $extractedAttributes[$key] = $value;
        }

        return $extractedAttributes;
    }
protected function extractRelationshipAttributes($columnName, array $attributes)
    {
        $attributes = filter_array_keys($attributes, function ($key) use ($columnName) {
            return starts_with($key, $columnName . '.');
        });

        $extractedAttributes = [];

        foreach ($attributes as $key => $value) {
            $key = substr($key, strlen($columnName) + 1);
            $extractedAttributes[$key] = $value;
        }

        return $extractedAttributes;
    }
protected function extractRelationshipAttributes ( $ columnName , array $ attributes ) { $ attributes = filter_array_keys ( $ attributes , function ( $ key ) use ( $ columnName ) { return starts_with ( $ key , $ columnName . '.' ) ; } ) ; $ extractedAttributes = [ ] ; foreach ( $ attributes as $ key => $ value ) { $ key = substr ( $ key , strlen ( $ columnName ) + 1 ) ; $ extractedAttributes [ $ key ] = $ value ; } return $ extractedAttributes ; }
Extract the attributes meant for a particular relationship.

@param  string $columnName
@param  array  $attributes
@return array
Extract the attributes meant for a particular relationship .