From 7bfec123a589ff63af980fa5b13ddacc9b0f611e Mon Sep 17 00:00:00 2001 From: Nadim Salloum Date: Mon, 21 Feb 2022 16:52:42 +0100 Subject: [PATCH] fix issue with match --- app/Models/Payment.php | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/app/Models/Payment.php b/app/Models/Payment.php index 0a7dea2..95e45a2 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -42,20 +42,26 @@ class Payment extends Model public function getTypeAttribute($type) { - return match ($type) { - PaymentType::Transaction() => 'Banküberweisung', - PaymentType::Cash() => 'Barzahlung', - default => 'Überweisung via Cembra', - }; + switch ($type) { + case PaymentType::Transaction(): + return 'Banküberweisung'; + case PaymentType::Cash(): + return 'Barzahlung'; + default: + return 'Überweisung via Cembra'; + }; } public function getTypeTextAttribute() { - return match ($this->type) { - 'Banküberweisung' => 'via Banküberweisung erhalten', - 'Barzahlung' => 'in bar erhalten', - default => 'via Cembra-Überweisung erhalten', - }; + switch ($this->type) { + case 'Banküberweisung': + return 'via Banküberweisung erhalten'; + case 'Barzahlung': + return 'in bar erhalten'; + default: + return 'via Cembra-Überweisung erhalten'; + }; } public function getPrintLinkAttribute()