1. Go to this page and download the library: Download ft-ugm/google-calendar library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ft-ugm / google-calendar example snippets
use FtUgm\GoogleCalendar\GoogleCalendar;
$calendar = new GoogleCalendar([
'base_url' => 'https://calendar-api.ft.ugm.ac.id',
'token' => 'GOOGLE_CALENDAR_API_TOKEN',
]);
use FtUgm\GoogleCalendar\Event;
$event = new Event([
'summary' => 'IT Team Discussion',
'description' => 'Discussion about the development of the correspondence service.',
'start' => [
'dateTime' => '2026-09-15T10:00:00+07:00',
'timeZone' => 'Asia/Jakarta',
],
'end' => [
'dateTime' => '2026-09-15T11:00:00+07:00',
'timeZone' => 'Asia/Jakarta',
],
'location' => 'IT Room',
'attendees' => [
[
'email' => '[email protected]',
],
],
]);
$event = $calendar->createEvent($event);
echo $event->getId();
echo $event->getHtmlLink();
'start' => new \DateTime(
'2026-09-15 10:00:00',
new \DateTimeZone('Asia/Jakarta')
),
'end' => new \DateTime(
'2026-09-15 11:00:00',
new \DateTimeZone('Asia/Jakarta')
),