Skip to main content

Google Calendar

Configuration

Scopes (from config/services.php):
  • Google_Service_Calendar::CALENDAR — read/write calendar
  • Google_Service_Calendar::CALENDAR_EVENTS — read/write events
  • Google_Service_Oauth2::USERINFO_EMAIL — user email
  • Google_Service_Oauth2::USERINFO_PROFILE — user profile

OAuth flow

File: app/Http/Controllers/Integrations/GoogleIntegrationController.php Same pattern as Zoom: tutor connects Google account, tokens stored in oauth_service_tokens.

Calendar service

File: app/Models/Services/CalendarService.php

Calendar event model

File: app/Models/v1/CalendarEvent.php

Calendar list model

File: app/Models/CalendarList.php

How it’s used

  1. Availability checking: When calculating available time slots, AvailabilityService calls CalendarService::getCalendarEvents() to exclude times that clash with the tutor’s Google Calendar events.
  2. Lesson creation: When a lesson is booked, calendar events can be created on the tutor’s Google Calendar. The event ID is stored in calendar_events.

Checking connection


Google Maps

Configuration

Service

File: app/Models/Services/Google/GoogleMapsAPI.php Uses Guzzle HTTP client (not the Google SDK) to call the Maps API directly.

Value objects

Where Maps API is used

  1. Address search: AddressService::searchPostCode() — geocodes a postcode and returns matching addresses
  2. Lesson address display: Booking emails include Google Maps links to lesson addresses
  3. The BlackBox microservice also uses Google Maps Distance Matrix API for travel time calculations