src/Metable.php
public function syncMeta($array)
    {
        $meta = [];

        foreach ($array as $key => $value) {
            $meta[$key] = $this->makeMeta($key, $value);
        }

        $this->meta()->delete();
        $this->meta()->saveMany($meta);

        // Update cached relationship.
        $collection = $this->makeMeta()->newCollection($meta);
        $this->setRelation('meta', $collection);
    }
public function syncMeta($array)
    {
        $meta = [];

        foreach ($array as $key => $value) {
            $meta[$key] = $this->makeMeta($key, $value);
        }

        $this->meta()->delete();
        $this->meta()->saveMany($meta);

        // Update cached relationship.
        $collection = $this->makeMeta()->newCollection($meta);
        $this->setRelation('meta', $collection);
    }
public function syncMeta ( $ array ) { $ meta = [ ] ; foreach ( $ array as $ key => $ value ) { $ meta [ $ key ] = $ this -> makeMeta ( $ key , $ value ) ; } $ this -> meta ( ) -> delete ( ) ; $ this -> meta ( ) -> saveMany ( $ meta ) ; // Update cached relationship. $ collection = $ this -> makeMeta ( ) -> newCollection ( $ meta ) ; $ this -> setRelation ( 'meta' , $ collection ) ; }
Replace all associated `Meta` with the keys and values provided.

@param array|Traversable $array

@return void
Replace all associated Meta with the keys and values provided .