feat: add withSoftDeleted functionality in base model

This commit is contained in:
Ali BARIN
2022-09-29 11:18:03 +02:00
parent 8be352765e
commit 816d63676d

View File

@@ -33,6 +33,11 @@ class ExtendedQueryBuilder<M extends Model, R = M[]> extends Model.QueryBuilder<
return super.delete(); return super.delete();
} }
withSoftDeleted() {
this.context().withSoftDeleted = true;
return this;
}
restore() { restore() {
return this.patch({ return this.patch({
[DELETED_COLUMN_NAME]: null, [DELETED_COLUMN_NAME]: null,