public function fillJsonAttribute($key, $value)
    {
        [$key, $path] = explode('->', $key, 2);

        $this->attributes[$key] = $this->asJson($this->getArrayAttributeWithValue(
            $path, $key, $value
        ));

        return $this;
    }
public function fillJsonAttribute($key, $value)
    {
        [$key, $path] = explode('->', $key, 2);

        $this->attributes[$key] = $this->asJson($this->getArrayAttributeWithValue(
            $path, $key, $value
        ));

        return $this;
    }
public function fillJsonAttribute ( $ key , $ value ) { [ $ key , $ path ] = explode ( '->' , $ key , 2 ) ; $ this -> attributes [ $ key ] = $ this -> asJson ( $ this -> getArrayAttributeWithValue ( $ path , $ key , $ value ) ) ; return $ this ; }
Set a given JSON attribute on the model.

@param  string  $key
@param  mixed  $value
@return $this
Set a given JSON attribute on the model .