protected function castAttributes($attributes)
    {
        return $this->using
                    ? $this->newPivot()->fill($attributes)->getAttributes()
                    : $attributes;
    }
protected function castAttributes($attributes)
    {
        return $this->using
                    ? $this->newPivot()->fill($attributes)->getAttributes()
                    : $attributes;
    }
protected function castAttributes ( $ attributes ) { return $ this -> using ? $ this -> newPivot ( ) -> fill ( $ attributes ) -> getAttributes ( ) : $ attributes ; }
Cast the given pivot attributes.

@param  array $attributes
@return array
Cast the given pivot attributes .