PHPackages                             senky/calendar-links - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. senky/calendar-links

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

senky/calendar-links
====================

Generate add to calendar links for Google, iCal and other calendar systems

1.4.2(5y ago)01.6kMITPHPPHP ^7.2 || ^8.0

Since Sep 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/senky/calendar-links)[ Packagist](https://packagist.org/packages/senky/calendar-links)[ Docs](https://github.com/spatie/calendar-links)[ Fund](https://spatie.be/open-source/support-us)[ RSS](/packages/senky-calendar-links/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (20)Used By (0)

Generate add to calendar links for Google, iCal and other calendar systems
==========================================================================

[](#generate-add-to-calendar-links-for-google-ical-and-other-calendar-systems)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fa8b57daf1e7393788a39b25dedabec0f09f2246bb1d7ffddb9016cc395124c3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f63616c656e6461722d6c696e6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/calendar-links)[![Total Downloads](https://camo.githubusercontent.com/e9e0eb6ba22835faa77d8a75caf9fde7a78fdbce884dd83551b43ad9470e15db/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f63616c656e6461722d6c696e6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/calendar-links)[![Test](https://github.com/spatie/calendar-links/workflows/Test/badge.svg)](https://github.com/spatie/calendar-links/workflows/Test/badge.svg)[![Quality Score](https://camo.githubusercontent.com/696d893d6cb116a9779dc8c1151ccc66e48c68be3a1ea44bdccde7a5c225ce70/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7370617469652f63616c656e6461722d6c696e6b732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/spatie/calendar-links)

Using this package you can generate links to add events to calendar systems. Here's a quick example:

```
use Spatie\CalendarLinks\Link;

Link::create(
    'Birthday',
    DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 09:00'),
    DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 18:00')
)->google();
```

This will output: `https://calendar.google.com/calendar/render?action=TEMPLATE&text=Birthday&dates=20180201T090000/20180201T180000&sprop=&sprop=name:`

If you follow that link (and are authenticated with Google) you'll see a screen to add the event to your calendar.

The package can also generate ics files that you can open in several email and calendar programs, including Microsoft Outlook, Google Calendar, and Apple Calendar.

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/2a7934197c91fcb39e7eaf03a4b1a3dc4242cab62281ba4a2f15b059f2feade8/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f63616c656e6461722d6c696e6b732e6a70673f743d31)](https://spatie.be/github-ad-click/calendar-links)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require spatie/calendar-links
```

Usage
-----

[](#usage)

```
