Add an install prompt to Laravel

To add an install prompt on Laravel, paste the InstantPWA snippet into resources/views/layouts/app.blade.php via Blade layout <head>, alongside @vite or @mix directives. The popup captures the browser's native install signal where supported and falls back to a guided walkthrough on iOS Safari, so every visitor sees a clear path to installing your Laravel site as an app.

Steps

  1. 1

    Open resources/views/layouts/app.blade.php

    Go to Blade layout <head>, alongside @vite or @mix directives.

  2. 2

    Paste the InstantPWA snippet

    Drop the one-line async script tag in the Laravel head section — no build step or dependency install.

  3. 3

    Configure the trigger

    In your InstantPWA dashboard, set when the popup appears — on page load, after N seconds, or after a scroll/engagement threshold.

  4. 4

    Publish

    Save/publish in Laravel so the change goes live — most builders require an explicit publish step before custom code runs.

  5. 5

    Verify on a phone

    Open your live Laravel URL on a mobile device (not the editor preview) to confirm the popup renders.

Constraints to know

  • If you set a Content-Security-Policy header via middleware (common in Laravel Sanctum/Fortify starter kits), you must allow-list the InstantPWA script domain or it will be blocked.
  • Run php artisan view:clear after editing the layout in environments where Blade view caching is enabled, or the change won't appear until the cache naturally expires.

FAQ

Does the install prompt work on iOS Laravel visitors?+

iOS Safari never fires the native beforeinstallprompt event, so InstantPWA shows a share-sheet walkthrough instead — visitors still get a clear add-to-home-screen path.

Will this conflict with other scripts on my site?+

No — InstantPWA is a single first-party async script with no third-party dependencies, so it doesn't block or compete with analytics or chat widgets.

Do I need to touch anything else in Laravel besides Blade layout <head>, alongside @vite or @mix directives?+

No — the head snippet is the only integration point; InstantPWA hosts the manifest and service worker for you.

Ready to set this up on Laravel?

1,000 free impressions. No credit card.

Get started