$conflicts description => first night of the portal occupation * @return list the conflicts reported for the first time */ public function handle(Channel $channel, array $conflicts): array { $new = []; foreach ($conflicts as $description => $startsOn) { $message = $this->inbox->post( InboxMessageKind::ChannelConflict, $channel->id.':'.sha1($description), 'Mögliche Doppelbuchung über '.$channel->name, $description, $channel, OccupancyCalendar::getUrl(['monat' => $startsOn->format('Y-m'), 'wohnung' => $channel->property_id]), ); if ($message) { $new[] = $description; } } if ($new !== []) { rescue(fn () => Mail::to(Settings::notificationRecipients())->send(new ChannelConflict($channel, $new))); } return $new; } }