π Laravel Cloud - Deploy & Cache Issues β
π PROBLEMA IDENTIFICATO β
Locale vs Stage differenti:
- Locale (saasykit-tenancy.test): Mostra menu aggiornato β
- Stage (blade.laravel.cloud): Mostra menu vecchio β
Causa: Codice pushato su GitHub ma Laravel Cloud non ha deployato o cache non pulita.
β SOLUZIONI β
1. Triggera Deploy Manuale β
Se Laravel Cloud ha auto-deploy disabilitato:
- Vai su Laravel Cloud Dashboard
- Trova il tuo progetto "blade"
- Tab "Deployments"
- Click "Deploy Now" / "Trigger Deployment"
- Aspetta completion (~2-5 min)
2. Pulisci Cache dopo Deploy β
Laravel Cloud NON pulisce automaticamente tutte le cache dopo deploy.
SSH nel container:
# Dalla dashboard Laravel Cloud, apri "SSH" terminal
# Oppure usa CLI:
# laravel-cloud ssh blade
# Una volta dentro:
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan filament:cache-componentsOppure via API/Webhook (se configurato):
curl -X POST https://blade.laravel.cloud/api/clear-cache \
-H "Authorization: Bearer YOUR_TOKEN"3. Verifica Git Branch β
Assicurati che Laravel Cloud stia deployando dal branch corretto:
Dashboard Laravel Cloud:
- Settings β Deployment
- Verifica "Branch" =
main(o il tuo branch) - Verifica "Auto Deploy" = ON
- Verifica ultimo deploy commit =
720e066
4. Force Clear Browser Cache β
A volte Γ¨ cache browser:
Chrome:
Cmd/Ctrl + Shift + R (hard refresh)Safari:
Cmd + Option + E (empty cache)
Cmd + R (refresh)Firefox:
Cmd/Ctrl + Shift + Delete β Clear cache5. Verifica Asset Compilation β
Se hai modificato file Filament/Livewire:
Laravel Cloud auto-compila assets, ma verifica:
# SSH nel container
npm run build
php artisan optimize:clearπ DEBUG: Verifica Versione Deploy β
Aggiungi temporary check in locale:
- Aggiungi in
CalendarSettings.php:
// Top del file
dd('Version: 720e066 - Latest');- Push commit
- Triggera deploy
- Apri stage β Dovrebbe mostrare
dd()con versione - Se mostra versione vecchia β Deploy non completato
π CHECKLIST DEPLOY LARAVEL CLOUD β
- [ ] Commit pushato su GitHub (
git push origin main) - [ ] Deploy triggerato (auto o manuale)
- [ ] Deploy completato (check dashboard)
- [ ] Cache pulita post-deploy
- [ ] Browser cache cleared
- [ ] Verifica commit hash in produzione
π― QUICK FIX β
Approccio piΓΉ veloce:
- Vai su Laravel Cloud Dashboard
- Click "Settings" β "Environment"
- Aggiungi variabile temporanea (es.
CLEAR_CACHE=true) - Save (triggera auto-redeploy)
- Aspetta deploy completion
- Apri stage β Dovrebbe essere aggiornato
π WORKFLOW CORRETTO β
LOCAL:
git add -A
git commit -m "fix"
git push origin main
β
GITHUB:
Commit ricevuto
β
LARAVEL CLOUD:
Webhook GitHub triggered (se auto-deploy ON)
β
1. Pull latest code
2. composer install
3. npm run build (se assets changed)
4. php artisan migrate --force
5. php artisan optimize
β
β οΈ MANCA (manuale):
6. php artisan cache:clear
7. php artisan filament:cache-components
β
BROWSER:
Hard refresh (Cmd+Shift+R)π‘ NOTA IMPORTANTE β
Laravel Cloud a volte mantiene:
- Config cache
- Route cache
- View cache
- Filament component cache
Anche dopo deploy. Sempre pulire cache manualmente dopo deploy con modifiche strutturali (nuove routes, resources, pages).
π¨ SE ANCORA NON FUNZIONA β
Verifica che il deploy sia effettivamente completato:
# SSH in Laravel Cloud
cd /var/www/html
git log --oneline -1
# Dovrebbe mostrare: 720e066 fix: SPA URL exceptions...Se mostra commit vecchio β Deploy non triggerato o fallito.
Prova queste soluzioni e fammi sapere! π