Calendar
Introduction
The Calendar tool manages events on either Google Calendar or any CalDAV server, including Apple's iCloud calendars. One driver is active at a time, chosen via LARACLAW_CALENDAR_DRIVER.
Choosing a Driver
LARACLAW_CALENDAR_DRIVER=google
# or
LARACLAW_CALENDAR_DRIVER=apple
Leaving it unset disables the tool.
Google Calendar Setup
You'll need a Google Cloud project with the Calendar API enabled and an OAuth client (desktop type). Run:
php artisan laraclaw:setup-calendar
The wizard walks you through authorizing the app and storing the OAuth token. It sets:
LARACLAW_CALENDAR_DRIVER=google
LARACLAW_GOOGLE_CREDENTIALS_JSON=oauth-credentials.json
LARACLAW_GOOGLE_TOKEN_JSON=oauth-token.json
LARACLAW_GOOGLE_CALENDAR_ID=primary
Laraclaw extends Spatie's Google Calendar integration to refresh and persist the OAuth token when it expires.
Apple CalDAV Setup
You'll need an app-specific password from your Apple ID account.
LARACLAW_CALENDAR_DRIVER=apple
LARACLAW_APPLE_CALDAV_SERVER=https://caldav.icloud.com
LARACLAW_APPLE_CALDAV_USERNAME=you@icloud.com
LARACLAW_APPLE_CALDAV_PASSWORD=xxxx-xxxx-xxxx-xxxx
LARACLAW_APPLE_CALDAV_CALENDAR=Home
The same driver works for any CalDAV server. Point LARACLAW_APPLE_CALDAV_SERVER at whatever endpoint you use.
Listing Events
| Parameter | Required | Description |
|---|---|---|
operation | Yes | list |
start | Yes | Range start. ISO 8601 or plain English ("tomorrow at 10am", "in 3 hours"). |
end | Yes | Range end |
Returns a JSON array of events with id, title, start, end, description, location, and attendees.
Creating and Updating Events
| Parameter | For | Description |
|---|---|---|
operation | Both | create or update |
id | Update | The event ID |
title | Both | Event title (required for create) |
start | Both | Start time. Natural language or ISO 8601. |
end | Both | End time. Defaults to start + 1 hour on create. |
description | Both | Event description |
location | Both | Event location |
attendees | Both | Array of email addresses to invite |
Update operations are partial. Pass only the fields you want to change.
Deleting Events
| Parameter | Required | Description |
|---|---|---|
operation | Yes | delete |
id | Yes | The event ID |
title | No | Used in the confirmation prompt |
Deletes require confirmation. The user is prompted in chat with the event title first.