π― Google Calendar Sync - Prossimi Step β
β SUCCESSO: Job Processato! β
Il job CreateGoogleCalendarEventJob Γ¨ stato eseguito con successo (789ms).
π Verifica Immediata β
1. Check appointment sync status β
php artisan booking:check-lastOutput atteso:
β Event ID: abc123xyz456
β Synced At: 30/10/2025 16:20
β Meet Link: https://meet.google.com/xxx-yyyy-zzzSe 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 β
- Apri https://calendar.google.com
- Login con account Google connesso (admin@admin.com)
- Vai a 11 Novembre 2025, ore 12:00
- 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 β
tail -200 storage/logs/laravel.log | grep -i "google"Cerca:
β Google Calendar event created successfullyβ SUCCESSOβ Failed to create Google Calendar eventβ ERROREInvalid Credentialsβ Token scadutoCalendar not foundβ Calendar ID sbagliato
π Se Evento NON Creato β
Causa 1: Token Google Scaduto/Invalido β
Sintomi:
[ERROR] Google_Service_Exception: Invalid CredentialsFix:
/dashboard/{uuid}/settings/calendar- Click "Disconnetti"
- Click "Connetti Calendario Google"
- Completa OAuth nuovamente
- Riprova sync:
php artisan google:test-sync 3
Causa 2: Calendar ID Sbagliato β
Sintomi:
[ERROR] Calendar 'primary' not foundDebug:
php artisan google:check-connection admin@admin.comFix: Verifica che google_calendar_id in user_calendars sia corretto.
Causa 3: Permessi Insufficienti β
Sintomi:
[ERROR] Insufficient PermissionFix: 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 β
- Vai su: https://blade.laravel.cloud/booking/qw
- Prenota: Qualsiasi data/ora disponibile
- Attendi: 30 secondi
- Verifica:bash
php artisan booking:check-last - Output atteso:
β Event ID: xyz789abc β Synced At: 30/10/2025 16:25 - 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 β
php artisan event:clear
php artisan cache:clear
php artisan config:clear
php artisan horizon:terminate
php artisan horizonFix 2: Verifica EventServiceProvider β
Controlla che in app/Providers/EventServiceProvider.php ci sia:
protected $listen = [
AppointmentBookedEvent::class => [
SyncAppointmentToGoogleCalendar::class,
],
];Fix 3: Riavvia Horizon β
php artisan horizon:terminate
sleep 5
php artisan horizonPoi fai nuova prenotazione test.
π Monitoring Continuo β
Log Real-Time Durante Booking β
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! π