Devise\Pages\Fields\LiveFieldValue::merge PHP Method

merge() public method

Merges in the array data into the field object json
public merge ( array $input ) : void
$input array
return void
    public function merge(array $input)
    {
        $this->__->values = array_merge($this->__->values, $input);
        $this->__->json = json_encode($this->__->values);
        $this->extract();
    }

Usage Example

Beispiel #1
0
 public function test_it_merges_data()
 {
     $obj = new LiveFieldValue('{}', 12, 'field');
     $obj->merge(['one' => 'two', 'buckle' => 'my shoe']);
     assertEquals('{"one":"two","buckle":"my shoe"}', $obj->toJSON());
 }