Calendar and event management for Laravel Enso
laravel-enso/calendar is a Laravel package for calendar and event management for laravel enso.
It currently has 4 GitHub stars and 40.174 downloads on Packagist (latest version 3.5.10).
Install it with composer require laravel-enso/calendar.
Discover more Laravel packages by laravel-enso
or browse all Laravel packages to compare alternatives.
Last updated
Calendar adds calendar and event management to Laravel Enso.
The package supports persisted calendars and events, recurring event sequences, attendees, reminders, all-day events, and custom readonly calendar sources that can project data from outside the calendar_events table.
It also ships with a builtin Birthday calendar, reminder notifications delivered through mail, database, and broadcast channels, plus the backend API and form metadata consumed by the Enso calendar frontend.
This package is normally installed as part of the Enso ecosystem.
For standalone installation in an Enso-based application:
composer require laravel-enso/calendar
Optional publishes:
php artisan vendor:publish --tag=calendar-provider
php artisan vendor:publish --tag=calendar-config
php artisan vendor:publish --tag=calendar-mail
php artisan vendor:publish --tag=calendar-factories
Birthday calendar configuration:
return [
'birthdays' => [
'roles' => ['*'],
],
];
The package also registers the reminder command:
php artisan enso:calendar:send-reminders
Once, Daily, Weekdays, Weekly, Monthly, and Yearly frequencies.Only This, This And Future, and All.Person records.laravel-enso/mails.Create and manage native calendars and events through the provided API routes, or register custom readonly calendars through the published provider:
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Calendars\OrdersCalendar;
class CalendarServiceProvider extends ServiceProvider
{
protected array $register = [
OrdersCalendar::class,
];
}
A custom calendar must implement LaravelEnso\Calendar\Contracts\CustomCalendar and return event objects that implement LaravelEnso\Calendar\Contracts\ProvidesEvent.
To dispatch due reminders manually:
php artisan enso:calendar:send-reminders
::: tip Tip
Use custom calendars for readonly projections coming from other bounded contexts. If users need to create or edit the events themselves, store them as native Calendar and Event records instead.
:::
::: warning Note
Reminder notifications depend on Laravel's scheduler. If the scheduler is not running, overdue reminders will remain pending until enso:calendar:send-reminders is executed.
:::
enso:calendar:send-remindersAll routes are registered under the core.calendar. name prefix and /api/core/calendar path prefix.
GET /api/core/calendar -> core.calendar.indexGET /api/core/calendar/create -> core.calendar.createPOST /api/core/calendar -> core.calendar.storeGET /api/core/calendar/{calendar}/edit -> core.calendar.editPATCH /api/core/calendar/{calendar} -> core.calendar.updateDELETE /api/core/calendar/{calendar} -> core.calendar.destroyGET /api/core/calendar/options -> core.calendar.optionsEvent routes are registered under the core.calendar.events. name prefix.
GET /api/core/calendar/events -> core.calendar.events.indexGET /api/core/calendar/events/create -> core.calendar.events.createPOST /api/core/calendar/events -> core.calendar.events.storeGET /api/core/calendar/events/{event}/edit -> core.calendar.events.editPATCH /api/core/calendar/events/{event} -> core.calendar.events.updateDELETE /api/core/calendar/events/{event} -> core.calendar.events.destroyLaravelEnso\Calendar\Models\Calendar
Key relations:
events()Exposed state:
name()color()private()readonly()LaravelEnso\Calendar\Models\Event
Key relations:
parent()events()attendees()calendar()reminders()Key methods:
store(?int $updateType = null)remove(?int $updateType)attendeeList()updateReminders($reminders)Supported frequencies:
OnceDailyWeekdaysWeeklyMonthlyYearlySupported recurrence update scopes:
Only ThisThis And FutureAllLaravelEnso\Calendar\Models\Reminder
Key methods and scopes:
send()scopeNotSent()scopeOverdue()scopeShouldSend()LaravelEnso\Calendar\Contracts\CalendarLaravelEnso\Calendar\Contracts\CustomCalendarLaravelEnso\Calendar\Contracts\ProvidesEventLaravelEnso\Calendar\Contracts\RoutableThe builtin BirthdayCalendar is the reference implementation for readonly custom calendars.
The event resource returned to the frontend includes:
idtitleparentIdisLastbodystartendlocationfrequencyrecurrenceEndsallDayreadonlyclassroutedeletableresizableThe event request validates:
It also prevents:
config/enso/calendar.php
Keys:
birthdays.rolesRequired Enso packages:
laravel-enso/core ↗laravel-enso/dynamic-methods ↗laravel-enso/enums ↗laravel-enso/forms ↗laravel-enso/helpers ↗laravel-enso/mails ↗laravel-enso/migrator ↗laravel-enso/people ↗laravel-enso/permissions ↗laravel-enso/rememberable ↗laravel-enso/select ↗laravel-enso/track-who ↗laravel-enso/users ↗Companion frontend package:
are welcome. Pull requests are great, but issues are good too.
Thank you to all the people who already contributed to Enso!