belongsTo(Contract::class)->withTrashed(); } public function getDateAttribute($date) { return Carbon::parse($date)->format('d.m.Y'); } public function getAmountAttribute($amount) { return Money::CHF($amount); } public function getAmountRawAttribute() { return $this->amount; } public function getTypeAttribute($type) { return $type == PaymentType::Transaction() ? 'Banküberweisung' : 'Barzahlung'; } public function getTypeTextAttribute() { return $this->type == PaymentType::Transaction() ? 'Als Banküberweisung erhalten' : 'in bar erhalten'; } public function getDeleteLinkAttribute() { return route('payments.destroy', [$this->contract->id, $this->id]); } }