fix issue with match

master
Nadim Salloum 2022-02-21 16:52:42 +01:00
parent 7e19c63c4f
commit 7bfec123a5
1 changed files with 16 additions and 10 deletions

View File

@ -42,20 +42,26 @@ class Payment extends Model
public function getTypeAttribute($type) public function getTypeAttribute($type)
{ {
return match ($type) { switch ($type) {
PaymentType::Transaction() => 'Banküberweisung', case PaymentType::Transaction():
PaymentType::Cash() => 'Barzahlung', return 'Banküberweisung';
default => 'Überweisung via Cembra', case PaymentType::Cash():
}; return 'Barzahlung';
default:
return 'Überweisung via Cembra';
};
} }
public function getTypeTextAttribute() public function getTypeTextAttribute()
{ {
return match ($this->type) { switch ($this->type) {
'Banküberweisung' => 'via Banküberweisung erhalten', case 'Banküberweisung':
'Barzahlung' => 'in bar erhalten', return 'via Banküberweisung erhalten';
default => 'via Cembra-Überweisung erhalten', case 'Barzahlung':
}; return 'in bar erhalten';
default:
return 'via Cembra-Überweisung erhalten';
};
} }
public function getPrintLinkAttribute() public function getPrintLinkAttribute()