From 624e1447ffc4a20541f604e9f583f19d3983e60c Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Thu, 22 Feb 2024 09:40:31 +0100 Subject: [PATCH] Update Calendar.php --- src/Services/Calendar.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Services/Calendar.php b/src/Services/Calendar.php index 3003fed..fe7dec6 100644 --- a/src/Services/Calendar.php +++ b/src/Services/Calendar.php @@ -12,6 +12,7 @@ use Eluceo\iCal\Domain\ValueObject\MultiDay; use Eluceo\iCal\Domain\ValueObject\SingleDay; use Eluceo\iCal\Domain\ValueObject\TimeSpan; +use Eluceo\iCal\Domain\ValueObject\Uri; use Eluceo\iCal\Presentation\Factory\CalendarFactory; use Illuminate\Support\Carbon; use TypiCMS\Modules\Events\Models\Event; @@ -46,8 +47,9 @@ public function add(Event $model) $iEvent = new IEvent(); $iEvent->setOccurrence($occurrence) ->setSummary($model->title) - ->setDescription(url($model->uri())) - ->setLocation(new Location($model->address, $model->venue)); + ->setDescription($model->summary ?? '') + ->setUrl(new Uri(url($model->present()->website))) + ->setLocation(new Location($model->venue ?? ' ' . $model->address ?? '')); // add it to the calendar $this->iCalendar->addEvent($iEvent); // $this->iCalendar->addTimeZone(TimeZone::createFromPhpDateTimeZone(new PhpDateTimeZone(config('app.timezone'))));