conduit-ui/calendar
Composer 安装命令:
composer require conduit-ui/calendar
包简介
Provider-agnostic Laravel calendar package — Google Calendar first, extensible to Outlook/iCal
README 文档
README
Provider-agnostic calendar client for Laravel. Google Calendar first, extensible to Outlook, iCal, and more.
Installation
composer require conduit-ui/calendar
Configuration
Publish the config:
php artisan vendor:publish --tag=calendar-config
Set your Google Calendar access token:
CALENDAR_DRIVER=google GOOGLE_CALENDAR_ACCESS_TOKEN=your-token
Usage
use ConduitUI\Calendar\CalendarManager; $calendar = app(CalendarManager::class); // List today's events $events = $calendar->driver()->listEvents( 'primary', now()->startOfDay(), now()->endOfDay(), ); // Each event is a CalendarEvent DTO foreach ($events as $event) { echo "{$event->start->format('g:ia')}: {$event->title}"; echo $event->location ? " ({$event->location})" : ''; echo PHP_EOL; } // Get a specific event $event = $calendar->driver()->getEvent('primary', 'event-id'); // List available calendars $calendars = $calendar->driver()->listCalendars();
CalendarEvent DTO
ConduitUI\Calendar\Contracts\CalendarEvent { string $id string $title ?string $description Carbon $start Carbon $end bool $allDay ?string $location array $attendees // [{email, name, status}] string $status // confirmed, tentative, cancelled ?string $htmlLink }
Adding Drivers
Implement CalendarProvider:
use ConduitUI\Calendar\Contracts\CalendarProvider; class OutlookDriver implements CalendarProvider { public function listCalendars(): Collection { ... } public function listEvents(string $calendarId, Carbon $start, Carbon $end, int $maxResults = 20): Collection { ... } public function getEvent(string $calendarId, string $eventId): CalendarEvent { ... } public function createEvent(string $calendarId, array $data): CalendarEvent { ... } }
Register in the CalendarManager or extend via config.
Requirements
- PHP 8.2+
- Laravel 12 or 13
- Saloon 4.x
- Spatie Laravel Data 4.x
License
MIT
统计信息
- 总下载量: 78
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-10