All platforms

Favicon for Laravel

How to add a favicon in Laravel

To add a favicon in Laravel, place your icon files directly in the public folder - Laravel's web root - and reference them in your Blade layout (e.g. resources/views/layouts/app.blade.php) with the asset() helper or root-absolute paths. Files in public/ are served straight from the document root.

What you need

  • favicon.ico plus PNG favicons (32x32), a 180x180 apple-touch-icon, and 192/512 PWA icons.
  • The public folder, which is Laravel's document root (where index.php lives).
  • A site.webmanifest for Android/PWA and maskable icons, linked from your Blade layout.

Step-by-step: add a favicon in Laravel

  1. Generate your icon set. Run your logo through Logo2Favicon to get favicon.ico, the PNG sizes, the Apple touch icon, the PWA icons, a maskable icon, and the manifest - in-browser, nothing uploaded.
  2. Add the files to public/. Copy favicon.ico, favicon-32x32.png, apple-touch-icon.png, and site.webmanifest into the public folder (alongside index.php). They are served from the web root.
  3. Link them in your Blade layout. Open your main layout, such as resources/views/layouts/app.blade.php, and add the icon, apple-touch-icon, and manifest link tags inside <head>, using the asset() helper for correct URLs.
  4. Clear caches and verify. If you cache views or use a CDN, clear them, then load the site and confirm the tab icon and that /favicon.ico and /site.webmanifest return 200.
Add to your Blade layout <head> (resources/views/layouts/app.blade.php):
<link rel="icon" href="{{ asset('favicon.ico') }}" sizes="any">
<link rel="icon" type="image/png" sizes="32x32" href="{{ asset('favicon-32x32.png') }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('apple-touch-icon.png') }}">
<link rel="manifest" href="{{ asset('site.webmanifest') }}">

Common mistakes to avoid

  • Putting icons in resources/ instead of public/ - resources/ is not web-accessible, so the files 404.
  • Hard-coding http://localhost paths instead of asset(), which breaks once APP_URL changes in production.
  • Editing storage or a controller expecting a favicon; the tags belong in the Blade layout's <head>.
  • Forgetting php artisan view:clear after editing a cached Blade layout, so the old head markup is served.
Free forever, no sign-up

Generate a complete icon set for Laravel

One logo in, every file out: favicon.ico, the PNG sizes, the Apple touch icon, Android and PWA icons, a maskable icon, the web manifest, and a copy-paste snippet ready for Laravel. Free, private, and generated in your browser.

Open the generator

Frequently asked questions

Where do I put the favicon in a Laravel project?
In the public folder, which is Laravel's document root (it holds index.php). Files there are served from the web root, so public/favicon.ico is reachable at /favicon.ico. Reference them in your Blade layout with asset().
Should I use asset() for the favicon in Laravel?
Yes. The asset() helper builds the URL from your APP_URL (and ASSET_URL/CDN if set), so the favicon path stays correct across local, staging, and production. Hard-coded URLs break when the domain changes.
Why is my Laravel favicon returning 404?
The file is probably in resources/ or another non-public folder. Move it into public/ (the document root), confirm the asset() path matches the filename, and clear any view cache with php artisan view:clear.
Which Blade file holds the favicon tags in Laravel?
Your shared layout, typically resources/views/layouts/app.blade.php (or a partials/head.blade.php you include). Put the icon link tags in its <head> so every page extending the layout gets the favicon.

Favicon guides for other platforms

New to favicons? Read the complete favicon guide and the icon size cheatsheet, or jump straight to the favicon generator.