/** * Delete entity values. * * @throws \InvalidArgumentException */ public function delete() { if (!in_array(SoftDeletes::class, class_uses_recursive(get_class($this->entity)), true) || $this->entity->forceDeleting) { $instance = new Value(); $connection = $this->entity->getConnection(); $connection->table($instance->getTable())->where('entity_id', $this->entity->getKey())->whereIn('property_id', $this->properties->pluck('id'))->delete(); } }