<?php namespace Orchestra\Model\Value;

use Illuminate\Support\Arr;
use Illuminate\Support\Fluent;

class Meta extends Fluent
{
    /**
     * Get an attribute from the container.
     *
     * @param  string  $key
     * @param  mixed   $default
     *
     * @return mixed
     */
    public function get($key, $default = null)
    {
        return Arr::get($this->attributes, $key, $default);
    }

    /**
     * Set a value from a key.
     *
     * @param  string  $key    A string of key to add the value.
     * @param  mixed   $value  The value.
     *
     * @return $this
     */
    public function put($key, $value = '')
    {
        Arr::set($this->attributes, $key, $value);

        return $this;
    }

    /**
     * Forget a key.
     *
     * @param  string  $key
     *
     * @return $this
     */
    public function forget($key)
    {
        Arr::forget($this->attributes, $key);

        return $this;
    }
}

<?php namespace Orchestra\Model\Value;

use Illuminate\Support\Arr;
use Illuminate\Support\Fluent;

class Meta extends Fluent
{
    /**
     * Get an attribute from the container.
     *
     * @param  string  $key
     * @param  mixed   $default
     *
     * @return mixed
     */
    public function get($key, $default = null)
    {
        return Arr::get($this->attributes, $key, $default);
    }

    /**
     * Set a value from a key.
     *
     * @param  string  $key    A string of key to add the value.
     * @param  mixed   $value  The value.
     *
     * @return $this
     */
    public function put($key, $value = '')
    {
        Arr::set($this->attributes, $key, $value);

        return $this;
    }

    /**
     * Forget a key.
     *
     * @param  string  $key
     *
     * @return $this
     */
    public function forget($key)
    {
        Arr::forget($this->attributes, $key);

        return $this;
    }

    /**
     * Transform each item in the attributes using a callback.
     *
     * @param  callable  $callback
     * @return $this
     */
    public function transform(callable $callback)
    {
        $this->attributes = $callback($this);

        return $this;
    }
}

Add simple transformer to fluent interface.
Add simple transformer to fluent interface.

Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
