From dbcb2b765906c399b77cd97a15542bb3475af3bb Mon Sep 17 00:00:00 2001 From: LookinGit Date: Mon, 23 Aug 2021 11:45:38 +0500 Subject: [PATCH] feat(SoftDeletes): add table name to onlyTrashed method --- src/SoftDeletes/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SoftDeletes/index.ts b/src/SoftDeletes/index.ts index 2b01047..74220bf 100644 --- a/src/SoftDeletes/index.ts +++ b/src/SoftDeletes/index.ts @@ -61,7 +61,8 @@ export function SoftDeletes> (supercl public static onlyTrashed( this: Model ): ModelQueryBuilderContract> { - return this.disableIgnore(this.query()).whereNotNull('deleted_at') + const query = this.query() + return this.disableIgnore(query).whereNotNull(`${query.model.table}.deleted_at`) } /**