Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
••
Sichere ProgrammierungCloudflare outage 2019: how one regex caused 27 minutes of 502s(29.09.2026 um 05:46 Uhr)
•
Sichere ProgrammierungHow boxr runs rootless: namespaces, a trampoline, and uid mapping(29.09.2026 um 05:47 Uhr)
••
Sichere ProgrammierungTech Stack for Thumbrella Cloud(29.09.2026 um 05:51 Uhr)
•
AI & KI NachrichtenStructured Outputs vs function calling in the OpenAI API(29.09.2026 um 05:53 Uhr)
•
Sichere ProgrammierungSMS OTP API Ownership: 6 Rate Limit Rules for SaaS Login Recovery(29.09.2026 um 05:55 Uhr)
•
Sichere ProgrammierungHow I Review AI-Generated HTML Before Publishing It(29.09.2026 um 05:58 Uhr)
•
Sichere ProgrammierungAI - Weights(29.09.2026 um 05:59 Uhr)
•••
Sichere ProgrammierungCloudflare outage 2019: how one regex caused 27 minutes of 502s(29.09.2026 um 05:46 Uhr)
•
Sichere ProgrammierungHow boxr runs rootless: namespaces, a trampoline, and uid mapping(29.09.2026 um 05:47 Uhr)
••
Sichere ProgrammierungTech Stack for Thumbrella Cloud(29.09.2026 um 05:51 Uhr)
•
AI & KI NachrichtenStructured Outputs vs function calling in the OpenAI API(29.09.2026 um 05:53 Uhr)
•
Sichere ProgrammierungSMS OTP API Ownership: 6 Rate Limit Rules for SaaS Login Recovery(29.09.2026 um 05:55 Uhr)
•
Sichere ProgrammierungHow I Review AI-Generated HTML Before Publishing It(29.09.2026 um 05:58 Uhr)
•
Sichere ProgrammierungAI - Weights(29.09.2026 um 05:59 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Creare una PWA con Laravel e Bootstrap | Building a PWA with Laravel and Bootstrap

Introduzione | Introduction Italiano: Questo articolo è disponibile sia in italiano che in inglese. Scrolla verso il basso per la versione in inglese. English: This article is available in both Italian and English. Scroll down for the …

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Introduzione | Introduction



Italiano: Questo articolo è disponibile sia in italiano che in inglese. Scrolla verso il basso per la versione in inglese.


English: This article is available in both Italian and English. Scroll down for the English version.







🇮🇹 Come ho trasformato un sito Laravel in una PWA moderna



Negli ultimi anni le Progressive Web App (PWA) sono diventate uno standard per offrire un’esperienza simile a quella delle app native, direttamente dal browser. Nel mio caso, volevo che il mio portfolio personale – sviluppato in Laravel + Bootstrap – potesse essere installato su dispositivi mobile e desktop, mantenendo la leggerezza di un sito classico.





1. Creare il Manifest



Il primo passo è aggiungere il file manifest.json nella directory public/.

Contiene le informazioni che definiscono il comportamento della tua app una volta installata.




{
"name": "Roberto Celano | Web Developer",
"short_name": "RC Dev",
"start_url": "/",
"display": "standalone",
"background_color": "#0d1117",
"theme_color": "#00bcd4",
"icons": [
{
"src": "/assets/icons/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/assets/icons/icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}






Ricorda di linkarlo nel tuo layout principale (resources/views/layouts/app.blade.php):




<link rel="manifest" href="{{ asset('manifest.json') }}">









2. Registrare il Service Worker



Nel file public/service-worker.js:




self.addEventListener("install", () => {
console.log("Service Worker installato");
});

self.addEventListener("fetch", (event) => {
event.respondWith(fetch(event.request));
});






E nella tua view Blade, aggiungi:




<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/service-worker.js")
.then(() => console.log("Service Worker registrato"))
.catch(err => console.error("Errore:", err));
}
</script>









3. Aggiungere il prompt d’installazione



Con questo snippet puoi mostrare il messaggio “Installa App”:




let deferredPrompt;
window.addEventListener("beforeinstallprompt", (e) => {
e.preventDefault();
deferredPrompt = e;
document.getElementById("installButton").style.display = "block";
});






Quando l’utente clicca il bottone:




installButton.addEventListener("click", async () => {
deferredPrompt.prompt();
const { outcome } = await deferredPrompt.userChoice;
console.log("Scelta utente:", outcome);
});









4. Test con Lighthouse



Apri Chrome → DevTools → Lighthouse → Progressive Web App.

Ti mostrerà se la tua PWA è installabile e conforme agli standard.





5. Risultato finale



Ora il mio sito robertocelano.dev può essere installato come app su smartphone, tablet e desktop.

L’esperienza è fluida, il caricamento è rapido e l’interfaccia mantiene il design Bootstrap originale.







🇬🇧 How I turned a Laravel site into a modern PWA



In recent years, Progressive Web Apps (PWA) have become the standard for bringing native-like experiences to the browser. In my case, I wanted my personal portfolio — built with Laravel + Bootstrap — to be installable on mobile and desktop, while keeping the simplicity of a classic website.





1. Create the Manifest



Add a manifest.json file in your public/ directory:




{
"name": "Roberto Celano | Web Developer",
"short_name": "RC Dev",
"start_url": "/",
"display": "standalone",
"background_color": "#0d1117",
"theme_color": "#00bcd4",
"icons": [
{
"src": "/assets/icons/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/assets/icons/icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}






Then link it in your main Blade layout (resources/views/layouts/app.blade.php):




<link rel="manifest" href="{{ asset('manifest.json') }}">









2. Register the Service Worker



In public/service-worker.js:




self.addEventListener("install", () => {
console.log("Service Worker installed");
});

self.addEventListener("fetch", (event) => {
event.respondWith(fetch(event.request));
});






And in your Blade view:




<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/service-worker.js")
.then(() => console.log("Service Worker registered"))
.catch(err => console.error("Error:", err));
}
</script>









3. Add the installation prompt



With this snippet you can show the “Install App” message:




let deferredPrompt;
window.addEventListener("beforeinstallprompt", (e) => {
e.preventDefault();
deferredPrompt = e;
document.getElementById("installButton").style.display = "block";
});






When the user clicks the button:




installButton.addEventListener("click", async () => {
deferredPrompt.prompt();
const { outcome } = await deferredPrompt.userChoice;
console.log("User choice:", outcome);
});









4. Test with Lighthouse



Open Chrome → DevTools → Lighthouse → Progressive Web App.

It will show whether your PWA meets installability standards.






5. Final result



Now robertocelano.dev can be installed like an app on smartphones, tablets, and desktops — fast, responsive, and consistent with its Bootstrap design.









Traduzione




Questo articolo è stato tradotto con l'ausilio di strumenti di traduzione professionali.

This article was translated with the help of professional translation tools.


2. Cyber Threat Intelligence & Forensik

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Creare una PWA con Laravel e Bootstrap | Building a PWA with Laravel and Bootstrap

Thematisch verwandte Begriffe: Creare, Laravel, Bootstrap, Building · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-101093 | Cotonti through 1.0.0 contains a cross-site request forgery vulnerabili…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag