Omschrijving
Want to create online calendars so that you can display them on an iPhone’s calendar app or in Google Calendar? This can be done by generating calendars in the iCalendar format (RFC 5545), a textual format that can be loaded by different applications.
The format of such calendars is defined in RFC 5545, which is not a pleasant reading experience. This package implements RFC 5545 and some extensions from RFC 7986 to provide you an easy to use API for creating calendars. It’s not our intention to implement these RFC’s entirely but to provide a straightforward API that’s easy to use.
Here’s an example of how to use it:
use SpatieIcalendarGeneratorComponentsCalendar;
use SpatieIcalendarGeneratorComponentsEvent;
Calendar::create('Laracon online')
->event(Event::create('Creating calender feeds')
->startsAt(new DateTime('6 March 2019 15:00'))
->endsAt(new DateTime('6 March 2019 16:00'))
)
->get();The above code will generate this string:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:spatie/icalendar-generator
NAME:Laracon online
X-WR-CALNAME:Laracon online
BEGIN:VEVENT
UID:5ef5c3f64cb2c
DTSTAMP;TZID=UTC:20200626T094630
SUMMARY:Creating calendar feeds
DTSTART:20190306T150000Z
DTEND:20190306T160000Z
DTSTAMP:20190419T135034Z
END:VEVENT
END:VCALENDAR