From 8f483ebb6bcc2c3c85208dd404f0f3980a9423b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Fri, 22 Jul 2022 00:52:06 +0300 Subject: [PATCH] fixed relation for sub-categories --- app/Models/Banking/Transaction.php | 2 +- app/Models/Common/Item.php | 2 +- app/Models/Document/Document.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Models/Banking/Transaction.php b/app/Models/Banking/Transaction.php index 11223408c..9563bcf34 100644 --- a/app/Models/Banking/Transaction.php +++ b/app/Models/Banking/Transaction.php @@ -105,7 +105,7 @@ class Transaction extends Model public function category() { - return $this->belongsTo('App\Models\Setting\Category')->withDefault(['name' => trans('general.na')]); + return $this->belongsTo('App\Models\Setting\Category')->withoutGlobalScope('App\Scopes\Category')->withDefault(['name' => trans('general.na')]); } public function children() diff --git a/app/Models/Common/Item.php b/app/Models/Common/Item.php index 77091aac6..217190d9d 100644 --- a/app/Models/Common/Item.php +++ b/app/Models/Common/Item.php @@ -55,7 +55,7 @@ class Item extends Model public function category() { - return $this->belongsTo('App\Models\Setting\Category')->withDefault(['name' => trans('general.na')]); + return $this->belongsTo('App\Models\Setting\Category')->withoutGlobalScope('App\Scopes\Category')->withDefault(['name' => trans('general.na')]); } public function taxes() diff --git a/app/Models/Document/Document.php b/app/Models/Document/Document.php index d5ca3237a..4189d96a8 100644 --- a/app/Models/Document/Document.php +++ b/app/Models/Document/Document.php @@ -93,7 +93,7 @@ class Document extends Model public function category() { - return $this->belongsTo('App\Models\Setting\Category')->withDefault(['name' => trans('general.na')]); + return $this->belongsTo('App\Models\Setting\Category')->withoutGlobalScope('App\Scopes\Category')->withDefault(['name' => trans('general.na')]); } public function children()