Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Calendar Links Laravel Package

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.

View on GitHub
Deep Wiki
Context7
2.0

Release Notes: v2.0

See upgrade guide.

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.

Breaking Changes

  • PHP 8.3+ required — minimum PHP version bumped from 8.1 to 8.3
  • $from and $to are now DateTimeImmutable — previously DateTime
  • Link properties are now public readonly — $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 instead
  • Link::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.
  • Link constructor is now final — subclassing the constructor is no longer possible; use static factory methods
  • InvalidLink::invalidDateRange() removed — the deprecated method has been deleted; use InvalidLink::negativeDateRange() instead
  • BaseOutlook::baseUrl() visibility changed — from public to protected
  • WebOffice and WebOutlook classes are now final
  • Generator constants are now typed — e.g., const string FORMAT_HTML = 'html' (PHP 8.3 typed constants)
  • Instance properties replaced with class constants — $dateFormat, $dateTimeFormat in Google, Yahoo, and BaseOutlook are now private const values, preventing override via subclassing

New Features

  • Custom ICS PRODID — the Ics generator now accepts a PRODID option to customize the product identifier in generated ICS content
  • Link::createAllDay() returns static — previously returned self, now supports late static binding for subclasses

Bug Fixes

  • All-day events off by one day — fixed all-day events created via the constructor being 1 day short
  • ICS DTSTAMP RFC 5545 compliance — DTSTAMP now always uses UTC datetime for all-day events (previously used date-only format)
  • ICS DTSTART for all-day events — added VALUE=DATE parameter to DTSTART for all-day events per RFC 5545
  • ICS escape string RFC 5545 compliance — escapeString() now properly handles backslashes, semicolons, commas, and newlines per RFC 5545 section 3.3.11 (previously used addcslashes which was non-compliant)
  • ICS VALARM trigger fix — fixed reminder/alert not working when a specific date was set as the trigger time

Internal / Code Quality

  • declare(strict_types=1) added to all source files
  • Modern PHP 8.3+ features: typed class constants, #[\Override] attributes
  • DateTimeImmutable used throughout instead of mutable DateTime
  • PHPUnit #[Test] attributes replace [@test](https://github.com/test) annotations
  • PSR-12 coding style applied
  • Psalm upgraded to v6.15 with improved type annotations (@api, non-empty-string, non-empty-list)
  • Removed unnecessary clone calls thanks to immutable date objects

Made by @alies-dev and the community.

Full Changelog: https://github.com/spatie/calendar-links/compare/1.11.1...2.0

2.0-beta.1

What's Changed

Internal Updates

New Contributors

Full Changelog: https://github.com/spatie/calendar-links/compare/2.0-alpha.1...2.0-beta.1

1.11.1

What's changed:

Full Changelog: https://github.com/spatie/calendar-links/compare/1.11.0...1.11.1

2.0-alpha.1

What's Changed

BC breaks

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:

  • REMOVED: Method Spatie\CalendarLinks\Link#__get() was removed
  • CHANGED: Type of property Spatie\CalendarLinks\Link#$title changed from having no type to string
  • CHANGED: Type of property Spatie\CalendarLinks\Link#$from changed from having no type to DateTimeImmutable
  • CHANGED: Type of property Spatie\CalendarLinks\Link#$to changed from having no type to DateTimeImmutable
  • CHANGED: Type of property Spatie\CalendarLinks\Link#$description changed from having no type to string
  • CHANGED: Property Spatie\CalendarLinks\Link#$description changed default value from NULL to ''
  • CHANGED: Type of property Spatie\CalendarLinks\Link#$allDay changed from having no type to bool
  • CHANGED: Type of property Spatie\CalendarLinks\Link#$address changed from having no type to string
  • CHANGED: Property Spatie\CalendarLinks\Link#$address changed default value from NULL to ''
  • CHANGED: Method __construct() of class Spatie\CalendarLinks\Link became final
  • CHANGED: The return type of Spatie\CalendarLinks\Link::create() changed from no type to static
  • CHANGED: The return type of Spatie\CalendarLinks\Link::createAllDay() changed from self to the non-covariant static
  • CHANGED: The return type of Spatie\CalendarLinks\Link::createAllDay() changed from self to static
  • CHANGED: Parameter 1 of Spatie\CalendarLinks\Link::createAllDay() changed name from fromDate to from
  • CHANGED: The return type of Spatie\CalendarLinks\Link#description() changed from no type to static
  • CHANGED: The return type of Spatie\CalendarLinks\Link#address() changed from no type to static
  • REMOVED: Method Spatie\CalendarLinks\Exceptions\InvalidLink::invalidDateRange() was removed
  • REMOVED: Property Spatie\CalendarLinks\Generators\Yahoo#$dateFormat was removed
  • REMOVED: Property Spatie\CalendarLinks\Generators\Yahoo#$dateTimeFormat was removed
  • CHANGED: Class Spatie\CalendarLinks\Generators\WebOffice became final
  • REMOVED: Constant Spatie\CalendarLinks\Generators\WebOffice::BASE_URL was removed
  • REMOVED: Property Spatie\CalendarLinks\Generators\BaseOutlook#$dateFormat was removed
  • REMOVED: Property Spatie\CalendarLinks\Generators\BaseOutlook#$dateTimeFormat was removed
  • REMOVED: Property Spatie\CalendarLinks\Generators\BaseOutlook#$urlParameters was removed
  • CHANGED: Constant Spatie\CalendarLinks\Generators\WebOffice::BASE_URL visibility reduced from protected to private
  • CHANGED: Method baseUrl() of class Spatie\CalendarLinks\Generators\WebOffice visibility reduced from public to protected
  • CHANGED: Type of property Spatie\CalendarLinks\Generators\Ics#$dateFormat changed from having no type to string
  • CHANGED: Type of property Spatie\CalendarLinks\Generators\Ics#$dateTimeFormat changed from having no type to string
  • CHANGED: Type of property Spatie\CalendarLinks\Generators\Ics#$options changed from having no type to array
  • REMOVED: Property Spatie\CalendarLinks\Generators\BaseOutlook#$dateFormat was removed
  • REMOVED: Property Spatie\CalendarLinks\Generators\BaseOutlook#$dateTimeFormat was removed
  • CHANGED: Method baseUrl() of class Spatie\CalendarLinks\Generators\BaseOutlook visibility reduced from public to protected
  • CHANGED: Class Spatie\CalendarLinks\Generators\WebOutlook became final
  • REMOVED: Constant Spatie\CalendarLinks\Generators\WebOutlook::BASE_URL was removed
  • REMOVED: Property Spatie\CalendarLinks\Generators\BaseOutlook#$dateFormat was removed
  • REMOVED: Property Spatie\CalendarLinks\Generators\BaseOutlook#$dateTimeFormat was removed
  • REMOVED: Property Spatie\CalendarLinks\Generators\BaseOutlook#$urlParameters was removed
  • CHANGED: Constant Spatie\CalendarLinks\Generators\WebOutlook::BASE_URL visibility reduced from protected to private
  • CHANGED: Method baseUrl() of class Spatie\CalendarLinks\Generators\WebOutlook visibility reduced from public to protected
  • REMOVED: Property Spatie\CalendarLinks\Generators\Google#$dateFormat was removed
  • REMOVED: Property Spatie\CalendarLinks\Generators\Google#$dateTimeFormat was removed

Full Changelog: https://github.com/spatie/calendar-links/compare/1.11.0...2.0-alpha.1

1.11.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/calendar-links/compare/1.10.0...1.11.0

1.10.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/calendar-links/compare/1.9.0...1.10.0

1.9.0

What's Changed

Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.6...1.9.0

1.8.6

What's Changed

Fixes:

New Contributors

Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.5...1.8.6

1.8.5

What's Changed

Fixes

Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.4...1.8.5

1.8.4

What's Changed

Fixes

Internal

Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.3...1.8.4

1.8.3

Fixes

Fixed

Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.2...1.8.3

1.8.2

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.1...1.8.2

1.8.1

What's Changed

  • Remove PHP 7.4 support
  • Update dependencies

Full Changelog: https://github.com/spatie/calendar-links/compare/1.8.0...1.8.1

1.8.0

What's Changed

Changed

Fixed

New Contributors

Full Changelog: https://github.com/spatie/calendar-links/compare/1.7.2...1.8.0

1.7.2

What's Changed

Full Changelog: https://github.com/spatie/calendar-links/compare/1.7.1...1.7.2

1.7.1

What's Changed

Full Changelog: https://github.com/spatie/calendar-links/compare/1.7.0...1.7.1

1.7.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/calendar-links/compare/1.6.0...1.7.0

1.6.0

Changed

  • Drop support for PHP 7.2 and PHP 7.3
1.5.0

Changed

  • ICS: support URLs as option: $link->ics(['URL' => https://your.domain/event.html]) (@gulios)
  • ICS: support all day events spanning multiple days (@mrshowerman)
  • ICS: don't use base64 encoding for test snapshots (to improve readability and debugging experience)
1.4.4

Fixed

  • Yahoo link doesn’t work (yahoo changed param names) (@mukeshsah08).
  • Exception message on invalid dates range (idea by @jason-nabooki).
1.4.3

Changed

  • Google: use UTC timezone to bypass problems with some timezone names unsupported by Google calendar (⚠️ backwards-incompatible if you extended Google Generator) (by @senky)

Fixed

  • Outlook: Spaces replaced by "+" on Outlook.com #109 (by @iosley)
1.4.2

Changed

  • Simplify extending of ICS Generator (c705b17)
1.4.1

Changed

  • Simplify extending of WebOutlook (e.g. for Office365)
  • Yahoo: use allday parameter only for a single-day events (67517bd70cae21309fe0eccca97db2d41e45aed3)
  • Improve exception hierarchy: InvalidLink now extends \InvalidArgumentException

Added

  • Add more tests, reorganize existing
1.4.0

Added

Changed

  • Require PHP 7.2+
1.3.0
  • Support custom generators ($link->formatWith(new \Your\Generator())
  • Fix iCal links that contains special chars (use base64 for encoding)
  • Fix Outlook links: use new base URI and datetime formats
  • Fix Yahoo links: events had invalid end datetime (due to a bug on Yahoo side)
1.2.4
  • Fix Google links for all-day events (use next day as end-date for single-day events)
  • Fix Outlook links for all-day events (omit enddt for single-day events)
  • Add a new Link::createAllDay static constructor to simplify creating of all-day events
1.2.3
  • Fix iCal all day links (use DURATION according RFC 5545) #53
1.2.2
  • Fix Yahoo links for multiple days events
1.2.1
  • Fix ics: Use CRLF instead of LF (according RFC 5545)
  • Fix ics: Specify UID property (according RFC 5545)
  • Fix ics: Escape ; character (according RFC 5545)
  • Fix ics: Remove empty new line from .ics files
1.2.0
  • Support timezones
  • Add outlook.com link generator
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport