spatie/calendar-links
Generate “Add to calendar” links and ICS files for events. Supports Google Calendar, iCal/Apple Calendar, Outlook and more. Define title, start/end, description and location, then get shareable URLs or downloadable .ics content for your app.
TL;DR: for 95% installations, no actions required. The biggest change: Link::create() is not longer has 3rd parameter allDay: you need to use Link::createAllDay() instead.
$from and $to are now DateTimeImmutable — previously DateTime$title, $from, $to, and $allDay are public readonly; $description and $address are public. The magic __get() method has been removed.Link::create() no longer accepts $allDay parameter — use Link::createAllDay() for all-day events insteadLink::createAllDay() end date semantics changed — the $numberOfDays parameter now represents inclusive days (e.g., createAllDay('Event', $date, 1) creates a single-day event). The constructor now internally adds +1
day to convert to the exclusive end date expected by calendar services.InvalidLink::invalidDateRange() removed — the deprecated method has been deleted; use InvalidLink::negativeDateRange() insteadBaseOutlook::baseUrl() visibility changed — from public to protectedWebOffice and WebOutlook classes are now final$dateFormat, $dateTimeFormat in Google, Yahoo, and BaseOutlook are now private const values, preventing override via subclassingPRODID — the Ics generator now accepts a PRODID option to customize the product identifier in generated ICS contentLink::createAllDay() returns static — previously returned self, now supports late static binding for subclassesdeclare(strict_types=1) added to all source files#[\Override] attributesDateTimeImmutable used throughout instead of mutable DateTime#[Test] attributes replace [@test](https://github.com/test) annotationsMade by @alies-dev and the community.
Full Changelog: https://github.com/spatie/calendar-links/compare/1.11.1...2.0
Full Changelog: https://github.com/spatie/calendar-links/compare/2.0-alpha.1...2.0-beta.1
Full Changelog: https://github.com/spatie/calendar-links/compare/1.11.0...1.11.1
API changes:
Link::create(...) doesn't have a 4th parameter to declare event as a full-day. Instead, use Link::createAllDay(...)If you extended classes from the package or used non-private members directly, these BC changes may be breaking for you:
Spatie\CalendarLinks\Link#__get() was removedSpatie\CalendarLinks\Link#$title changed from having no type to stringSpatie\CalendarLinks\Link#$from changed from having no type to DateTimeImmutableSpatie\CalendarLinks\Link#$to changed from having no type to DateTimeImmutableSpatie\CalendarLinks\Link#$description changed from having no type to stringSpatie\CalendarLinks\Link#$description changed default value from NULL to ''Spatie\CalendarLinks\Link#$allDay changed from having no type to boolSpatie\CalendarLinks\Link#$address changed from having no type to stringSpatie\CalendarLinks\Link#$address changed default value from NULL to ''__construct() of class Spatie\CalendarLinks\Link became finalSpatie\CalendarLinks\Link::create() changed from no type to staticSpatie\CalendarLinks\Link::createAllDay() changed from self to the non-covariant staticSpatie\CalendarLinks\Link::createAllDay() changed from self to staticSpatie\CalendarLinks\Link::createAllDay() changed name from fromDate to fromSpatie\CalendarLinks\Link#description() changed from no type to staticSpatie\CalendarLinks\Link#address() changed from no type to staticSpatie\CalendarLinks\Exceptions\InvalidLink::invalidDateRange() was removedSpatie\CalendarLinks\Generators\Yahoo#$dateFormat was removedSpatie\CalendarLinks\Generators\Yahoo#$dateTimeFormat was removedSpatie\CalendarLinks\Generators\WebOffice became finalSpatie\CalendarLinks\Generators\WebOffice::BASE_URL was removedSpatie\CalendarLinks\Generators\BaseOutlook#$dateFormat was removedSpatie\CalendarLinks\Generators\BaseOutlook#$dateTimeFormat was removedSpatie\CalendarLinks\Generators\BaseOutlook#$urlParameters was removedSpatie\CalendarLinks\Generators\WebOffice::BASE_URL visibility reduced from protected to privateSpatie\CalendarLinks\Generators\WebOffice visibility reduced from public to protectedSpatie\CalendarLinks\Generators\Ics#$dateFormat changed from having no type to stringSpatie\CalendarLinks\Generators\Ics#$dateTimeFormat changed from having no type to stringSpatie\CalendarLinks\Generators\Ics#$options changed from having no type to arraySpatie\CalendarLinks\Generators\BaseOutlook#$dateFormat was removedSpatie\CalendarLinks\Generators\BaseOutlook#$dateTimeFormat was removedSpatie\CalendarLinks\Generators\BaseOutlook visibility reduced from public to protectedSpatie\CalendarLinks\Generators\WebOutlook became finalSpatie\CalendarLinks\Generators\WebOutlook::BASE_URL was removedSpatie\CalendarLinks\Generators\BaseOutlook#$dateFormat was removedSpatie\CalendarLinks\Generators\BaseOutlook#$dateTimeFormat was removedSpatie\CalendarLinks\Generators\BaseOutlook#$urlParameters was removedSpatie\CalendarLinks\Generators\WebOutlook::BASE_URL visibility reduced from protected to privateSpatie\CalendarLinks\Generators\WebOutlook visibility reduced from public to protectedSpatie\CalendarLinks\Generators\Google#$dateFormat was removedSpatie\CalendarLinks\Generators\Google#$dateTimeFormat was removedFull Changelog: https://github.com/spatie/calendar-links/compare/1.11.0...2.0-alpha.1
Full Changelog: https://github.com/spatie/calendar-links/compare/1.10.0...1.11.0
Full Changelog: https://github.com/spatie/calendar-links/compare/1.9.0...1.10.0
file, html) by @alies-dev in https://github.com/spatie/calendar-links/pull/185Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.6...1.9.0
Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.5...1.8.6
Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.4...1.8.5
Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.3...1.8.4
DESCRIPTION instead of X-ALT-DESC (as it has better support) by @cdubz in https://github.com/spatie/calendar-links/pull/158Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.1...1.8.2
Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.0...1.8.1
PRODID and DTSTAMP required parameters to make ICS valid by @makbeta in https://github.com/spatie/calendar-links/pull/153WebOffice and WebOutlook into a parent class by @lptnFull Changelog: https://github.com/spatie/calendar-links/compare/1.7.2...1.8.0
Full Changelog: https://github.com/spatie/calendar-links/compare/1.7.1...1.7.2
Full Changelog: https://github.com/spatie/calendar-links/compare/1.7.0...1.7.1
Full Changelog: https://github.com/spatie/calendar-links/compare/1.6.0...1.7.0
$link->ics(['URL' => https://your.domain/event.html]) (@gulios)allday parameter only for a single-day events (67517bd70cae21309fe0eccca97db2d41e45aed3)InvalidLink now extends \InvalidArgumentExceptionUID for ICS links (https://github.com/spatie/calendar-links/pull/85)\DateTimeImmutable::class)$link->formatWith(new \Your\Generator())enddt for single-day events)Link::createAllDay static constructor to simplify creating of all-day events; character (according RFC 5545)How can I help you explore Laravel packages today?