PHPackages                             erenav/laravel-icalendar - 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. erenav/laravel-icalendar

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

erenav/laravel-icalendar
========================

Laravel integration for erenav/icalendar — build, serve, and parse iCalendar feeds in Laravel.

v0.3.0(today)00MITPHPPHP &gt;=8.3CI failing

Since Jun 20Pushed todayCompare

[ Source](https://github.com/erenav/laravel-icalendar)[ Packagist](https://packagist.org/packages/erenav/laravel-icalendar)[ Docs](https://github.com/vanere/laravel-icalendar)[ RSS](/packages/erenav-laravel-icalendar/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (6)Versions (4)Used By (0)

erenav/laravel-icalendar
========================

[](#erenavlaravel-icalendar)

[![Latest Version](https://camo.githubusercontent.com/44b0951e35c467415f440b8554b8401ab66ff7a27af01952bfc30aa6ce158192/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6572656e61762f6c61726176656c2d6963616c656e6461722e737667)](https://packagist.org/packages/erenav/laravel-icalendar)[![Tests](https://github.com/erenav/laravel-icalendar/actions/workflows/ci.yml/badge.svg)](https://github.com/erenav/laravel-icalendar/actions/workflows/ci.yml)[![PHP Version](https://camo.githubusercontent.com/c677efc84c44dc5457aa1870e913c27e0bd1636c91b197ab7de8e5e36bec2cff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6572656e61762f6c61726176656c2d6963616c656e6461722e737667)](https://packagist.org/packages/erenav/laravel-icalendar)[![Total Downloads](https://camo.githubusercontent.com/aef5e903921d925ad79855d1fa0215aa5cef2e40139641afe61faf2a2d9dd623/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6572656e61762f6c61726176656c2d6963616c656e6461722e737667)](https://packagist.org/packages/erenav/laravel-icalendar)[![License](https://camo.githubusercontent.com/7c6ba108705e40391983af9bfb5497bc08c41b7c2cb7ca4b33359fbdc4fbf87f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6572656e61762f6c61726176656c2d6963616c656e6461722e737667)](LICENSE)

Laravel integration for [`erenav/icalendar`](https://github.com/erenav/icalendar) — build, serve, parse, and attach iCalendar (`.ics`) feeds from your Laravel app, with first-class Eloquent and Carbon support.

```
use Erenav\LaravelICalendar\Facades\ICalendar;
use Erenav\ICalendar\Component\Event;

return ICalendar::response(
    ICalendar::calendar()
        ->add(Event::build()->uid('1@app.test')->summary('Launch')->starts(now()))
        ->get()
); // → a downloadable text/calendar response
```

> All the modelling — events, recurrence, time zones, parsing — lives in the core package. See the [core README](https://github.com/erenav/icalendar) for the full object model. This package is the thin Laravel glue on top.

> 📖 **New here?** The [Recipes](docs/RECIPES.md) page has short, copy-paste examples for feeds, Eloquent mapping, mail attachments, and more.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 11 or 12

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

[](#installation)

```
composer require erenav/laravel-icalendar
```

The service provider and `ICalendar` facade are auto-discovered. Publish the config if you want to tweak defaults:

```
php artisan vendor:publish --tag=icalendar-config
```

```
// config/icalendar.php
return [
    'product_id'        => '-//' . env('APP_NAME', 'Laravel') . '//iCalendar//EN',
    'strict'            => false, // strict parse + serialize
    'include_timezones' => true,  // auto-inject VTIMEZONE on serialize
    'filename'          => 'calendar.ics',
    'uid_domain'        => null,  // defaults to APP_URL host
];
```

The `ICalendar` facade
----------------------

[](#the-icalendar-facade)

```
use Erenav\LaravelICalendar\Facades\ICalendar;

ICalendar::calendar();              // CalendarBuilder, pre-stamped with config PRODID
ICalendar::event();                 // EventBuilder
ICalendar::serialize($component);   // string (.ics); auto-includes VTIMEZONE per config
ICalendar::parse($icsString);       // Calendar  (lenient, or strict per config)
ICalendar::fromModels($models);     // Calendar from a collection of mappable models
ICalendar::response($calendar);     // a downloadable CalendarResponse
```

Mapping Eloquent models
-----------------------

[](#mapping-eloquent-models)

Implement `ProvidesCalendarEvent` and use the `InteractsWithCalendar` trait. The trait gives you a stable, deterministic UID (so re-exporting a record never duplicates it in calendar clients) and a `toIcs()` helper. Carbon attributes flow straight into the date setters.

```
use Illuminate\Database\Eloquent\Model;
use Erenav\ICalendar\Component\Event;
use Erenav\LaravelICalendar\Concerns\InteractsWithCalendar;
use Erenav\LaravelICalendar\Contracts\ProvidesCalendarEvent;

class Meeting extends Model implements ProvidesCalendarEvent
{
    use InteractsWithCalendar;

    protected $casts = ['starts_at' => 'datetime', 'ends_at' => 'datetime'];

    public function toCalendarEvent(): Event
    {
        return Event::build()
            ->uid($this->calendarUid())          // e.g. "Meeting-42@app.test"
            ->summary($this->title)
            ->starts($this->starts_at)            // Carbon → DateTimeInterface
            ->ends($this->ends_at)
            ->get();
    }
}
```

```
$meeting->toIcs();                                   // single-event .ics string
ICalendar::fromModels(Meeting::today()->get());      // Calendar of many
```

Serving a feed
--------------

[](#serving-a-feed)

`ICalendar::response()` (and the `response()->ics()` macro) return a `Responsable``text/calendar` download:

```
Route::get('/calendar.ics', function () {
    return ICalendar::response(
        ICalendar::fromModels(Meeting::upcoming()->get()),
        'meetings.ics',
    );
});

// or via the macro:
return response()->ics($calendar, 'meetings.ics');
```

Attaching to mail &amp; notifications
-------------------------------------

[](#attaching-to-mail--notifications)

`CalendarAttachment::for()` produces a standard Laravel mail `Attachment`, usable from Mailables and notification mail messages:

```
use Erenav\LaravelICalendar\CalendarAttachment;
use Erenav\LaravelICalendar\Facades\ICalendar;

public function toMail($notifiable): MailMessage
{
    $calendar = ICalendar::calendar()
        ->add($this->meeting->toCalendarEvent())
        ->get();

    return (new MailMessage)
        ->subject('Your meeting')
        ->line('See the attached invite.')
        ->attach(CalendarAttachment::for($calendar, 'invite.ics'));
}
```

Artisan
-------

[](#artisan)

```
php artisan icalendar:validate path/to/file.ics
# → "Valid iCalendar — 3 event(s), 4 component(s)."  (exit 0)
# → "Invalid iCalendar: …"                            (exit 1)
```

Recurrence &amp; time zones
---------------------------

[](#recurrence--time-zones)

These come from the core. A quick taste:

```
use Erenav\ICalendar\Recurrence\{Recurrence, Weekday};

$event = ICalendar::event()
    ->uid('standup@app.test')
    ->starts(now())
    ->recurrence(Recurrence::weekly()->on(Weekday::Monday, Weekday::Wednesday))
    ->get();

// Override-aware expansion across a calendar:
foreach ($calendar->occurrencesBetween(now(), now()->addMonth()) as $occurrence) {
    $occurrence->start;  // Carbon-compatible DateTimeImmutable
    $occurrence->event;  // the effective event for this instance
}
```

`ICalendar::serialize()` auto-injects `VTIMEZONE` definitions for the IANA zones your events use (toggle with `config('icalendar.include_timezones')`), so feeds are self-contained.

Testing
-------

[](#testing)

```
composer install
vendor/bin/phpunit
```

Tests run against a real Laravel app via [Orchestra Testbench](https://github.com/orchestral/testbench).

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/49ad369ef9b2048a4df1684204853a217ce15e661f6aa522bb26ae42e9750b7e?d=identicon)[vanere](/maintainers/vanere)

---

Top Contributors

[![vanere](https://avatars.githubusercontent.com/u/3731011?v=4)](https://github.com/vanere "vanere (6 commits)")

---

Tags

laravelfeediCalendaricsicalrfc5545calendar

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/erenav-laravel-icalendar/health.svg)

```
[![Health](https://phpackages.com/badges/erenav-laravel-icalendar/health.svg)](https://phpackages.com/packages/erenav-laravel-icalendar)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

9782.1M160](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k239.9k75](/packages/moonshine-moonshine)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3614.9k](/packages/linkxtr-laravel-qrcode)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
