From ef00815557bdeaa86bfc9f7c5e7ecd56ad662271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 18 Aug 2021 15:15:14 +0300 Subject: [PATCH] Transaction not edit, duplicate, delete etc button for Transferred --- app/Models/Banking/Transaction.php | 10 ++++++++++ .../transactions/show/top-buttons.blade.php | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/app/Models/Banking/Transaction.php b/app/Models/Banking/Transaction.php index cb7281a05..f6b1b778b 100644 --- a/app/Models/Banking/Transaction.php +++ b/app/Models/Banking/Transaction.php @@ -349,6 +349,16 @@ class Transaction extends Model } } + /** + * Check if the record is attached to a transfer. + * + * @return bool + */ + public function getHasTransferRelationAttribute() + { + return (bool) (optional($this->category)->id == optional($this->category)->transfer()); + } + /** * Get the title of type. * diff --git a/resources/views/components/transactions/show/top-buttons.blade.php b/resources/views/components/transactions/show/top-buttons.blade.php index 9481840e9..56a63bf0e 100644 --- a/resources/views/components/transactions/show/top-buttons.blade.php +++ b/resources/views/components/transactions/show/top-buttons.blade.php @@ -8,6 +8,7 @@