Skip to content

🎯 Google Calendar Sync - Prossimi Step ​

βœ… SUCCESSO: Job Processato! ​

Il job CreateGoogleCalendarEventJob Γ¨ stato eseguito con successo (789ms).


πŸ“‹ Verifica Immediata ​

1. Check appointment sync status ​

bash
php artisan booking:check-last

Output atteso:

βœ“ Event ID: abc123xyz456
βœ“ Synced At: 30/10/2025 16:20
βœ“ Meet Link: https://meet.google.com/xxx-yyyy-zzz

Se vedi ancora "βœ— NON sincronizzato": β†’ Job completato ma errore silenzioso β†’ Verifica log: tail -100 storage/logs/laravel.log | grep -A 20 "CreateGoogleCalendarEventJob"


2. Verifica Google Calendar Web ​

  1. Apri https://calendar.google.com
  2. Login con account Google connesso (admin@admin.com)
  3. Vai a 11 Novembre 2025, ore 12:00
  4. Dovresti vedere: "qw con ozzarini@dscom.it"

Se NON vedi l'evento: β†’ Problema Google API (token, permessi, calendar ID) β†’ Continua con step 3


3. Check log errori ​

bash
tail -200 storage/logs/laravel.log | grep -i "google"

Cerca:

  • βœ“ Google Calendar event created successfully β†’ SUCCESSO
  • βœ— Failed to create Google Calendar event β†’ ERRORE
  • Invalid Credentials β†’ Token scaduto
  • Calendar not found β†’ Calendar ID sbagliato

πŸ› Se Evento NON Creato ​

Causa 1: Token Google Scaduto/Invalido ​

Sintomi:

[ERROR] Google_Service_Exception: Invalid Credentials

Fix:

  1. /dashboard/{uuid}/settings/calendar
  2. Click "Disconnetti"
  3. Click "Connetti Calendario Google"
  4. Completa OAuth nuovamente
  5. Riprova sync: php artisan google:test-sync 3

Causa 2: Calendar ID Sbagliato ​

Sintomi:

[ERROR] Calendar 'primary' not found

Debug:

bash
php artisan google:check-connection admin@admin.com

Fix: Verifica che google_calendar_id in user_calendars sia corretto.


Causa 3: Permessi Insufficienti ​

Sintomi:

[ERROR] Insufficient Permission

Fix: Durante OAuth, assicurati di concedere TUTTI i permessi richiesti:

  • βœ… Visualizza calendario
  • βœ… Modifica calendario
  • βœ… Crea eventi

Riconnetti calendario con permessi completi.


βœ… Se Evento Creato con Successo ​

Test Automatico: Nuova Prenotazione ​

  1. Vai su: https://blade.laravel.cloud/booking/qw
  2. Prenota: Qualsiasi data/ora disponibile
  3. Attendi: 30 secondi
  4. Verifica:
    bash
    php artisan booking:check-last
  5. Output atteso:
    βœ“ Event ID: xyz789abc
    βœ“ Synced At: 30/10/2025 16:25
  6. Verifica Google Calendar: Evento presente!

πŸ” Diagnosi: PerchΓ© Job Non Dispatcato Automaticamente? ​

Se il test manuale funziona ma le prenotazioni normali NO:

Possibile causa: Event/Listener non triggerati.

Fix 1: Clear Cache Eventi ​

bash
php artisan event:clear
php artisan cache:clear
php artisan config:clear
php artisan horizon:terminate
php artisan horizon

Fix 2: Verifica EventServiceProvider ​

Controlla che in app/Providers/EventServiceProvider.php ci sia:

php
protected $listen = [
    AppointmentBookedEvent::class => [
        SyncAppointmentToGoogleCalendar::class,
    ],
];

Fix 3: Riavvia Horizon ​

bash
php artisan horizon:terminate
sleep 5
php artisan horizon

Poi fai nuova prenotazione test.


πŸ“Š Monitoring Continuo ​

Log Real-Time Durante Booking ​

bash
tail -f storage/logs/laravel.log | grep -E "(AppointmentBooked|CreateGoogleCalendar|Google Calendar)"

Fai prenotazione e osserva log in tempo reale.

Output atteso:

[info] Booking data received
[info] AppointmentBookedEvent dispatched
[info] CreateGoogleCalendarEventJob processing
[info] Google Calendar event created successfully

πŸ“‹ Checklist Finale ​

  • [ ] php artisan booking:check-last β†’ Event ID presente?
  • [ ] Google Calendar web β†’ Evento visibile?
  • [ ] Log β†’ "event created successfully"?
  • [ ] Nuova prenotazione test β†’ Sync automatico funziona?
  • [ ] Invito email ricevuto da ospite?

PROSSIMO STEP: Esegui php artisan booking:check-last e condividi l'output! πŸš€

Realizzato con ❀️ da DScom