booking !== null) { CaseLog::record($message->booking, 'mail', 'E-Mail '.match ($message->audience) { 'guest' => 'an den Gast', 'landlord' => 'an uns', default => 'im Testbetrieb an die Testadresse (nicht an den Gast)', }.': '.$message->subject, actor: CaseLog::SYSTEM, at: $message->sent_at); } }); } /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return ['sent_at' => 'immutable_datetime']; } /** * @return BelongsTo */ public function booking(): BelongsTo { return $this->belongsTo(Booking::class); } }