Laravel Favicon Package

Laravel Favicon Package

Laravel Favicon is a package by Marcel Pociot that enables you to create dynamic favicons based on your environment settings:

The package works by using a favicon() helper function in your template, which is then modified in the environments you configure:

<link rel="icon" type="image/png" sizes="32x32" href="{{ favicon(asset('favicon-32x32.png')) }}">

Here’s an example of the default enabled environment configuration at the time of writing to give you an idea the values you can specify:

'enabled_environments' => [
    'local' => [
        'text' => 'DEV',
        'color' => '#000000',
        'background_color' => '#ffffff',

It uses Intervention Image, which at the time of writing supports to processing extensions: gd and imagick. If you want to convert ICO files, you need to use the imagick configuration option.

The intended use of this package is for non-production environments. Environments that don’t have matching configuration values will return the original path/URI to the static icon.

Related: Laravel View X-Ray

You can learn more about the Laravel Favicon package at beyondcode/laravel-favicon. To learn how to install and use the package, check out the project’s README file.

Filed in: Laravel Packages


Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Full-Stack Developer
Nu Image Medical
Senior Software Developer
Remote (US ONLY)/Kenilworth, NJ
Senior Back-end Laravel API Developer - Immediate Contract (Full Time)
ApproveMe // Document Signing
Web Development Project Manager
Houston, TX
Swyft Filings
Experienced Laravel/VueJS Developer (Freelance)
Remote (preferably in the US)
Prosperly LLC
Senior React / Laravel Developer
The C.A.S.E. Engineering Group
Software Engineer