saveMetaData(request('meta', [])); }); } /** * Save metadata for the entity. * * @param array $data * * @return Model */ public function saveMetaData($data = []) { $this->meta->fill([locale() => $data])->save(); } /** * Get the meta for the entity. * * @return MorphToMany */ public function meta() { return $this->morphOne(MetaData::class, 'entity')->withDefault(); } }