protected function addMutatedAttributesToArray(array $attributes, array $mutatedAttributes)
    {
        foreach ($mutatedAttributes as $key) {
            // We want to spin through all the mutated attributes for this model and call
            // the mutator for the attribute. We cache off every mutated attributes so
            // we don't have to constantly check on attributes that actually change.
            if (! array_key_exists($key, $attributes)) {
                continue;
            }

            // Next, we will call the mutator for this attribute so that we can get these
            // mutated attribute's actual values. After we finish mutating each of the
            // attributes we will return this final array of the mutated attributes.
            $attributes[$key] = $this->mutateAttributeForArray(
                $key, $attributes[$key]
            );
        }

        return $attributes;
    }
protected function addMutatedAttributesToArray(array $attributes, array $mutatedAttributes)
    {
        foreach ($mutatedAttributes as $key) {
            // We want to spin through all the mutated attributes for this model and call
            // the mutator for the attribute. We cache off every mutated attributes so
            // we don't have to constantly check on attributes that actually change.
            if (! array_key_exists($key, $attributes)) {
                continue;
            }

            // Next, we will call the mutator for this attribute so that we can get these
            // mutated attribute's actual values. After we finish mutating each of the
            // attributes we will return this final array of the mutated attributes.
            $attributes[$key] = $this->mutateAttributeForArray(
                $key, $attributes[$key]
            );
        }

        return $attributes;
    }
protected function addMutatedAttributesToArray ( array $ attributes , array $ mutatedAttributes ) { foreach ( $ mutatedAttributes as $ key ) { // We want to spin through all the mutated attributes for this model and call // the mutator for the attribute. We cache off every mutated attributes so // we don't have to constantly check on attributes that actually change. if ( ! array_key_exists ( $ key , $ attributes ) ) { continue ; } // Next, we will call the mutator for this attribute so that we can get these // mutated attribute's actual values. After we finish mutating each of the // attributes we will return this final array of the mutated attributes. $ attributes [ $ key ] = $ this -> mutateAttributeForArray ( $ key , $ attributes [ $ key ] ) ; } return $ attributes ; }
Add the mutated attributes to the attributes array.

@param  array  $attributes
@param  array  $mutatedAttributes
@return array
Add the mutated attributes to the attributes array .