PHPackages                             beyondcode/laravel-favicon - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. beyondcode/laravel-favicon

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

beyondcode/laravel-favicon
==========================

Create dynamic favicons based on your environment settings.

1.9.0(1mo ago)37345.5k—8%38MITPHPPHP ^8.1CI passing

Since Jan 29Pushed 1mo ago8 watchersCompare

[ Source](https://github.com/beyondcode/laravel-favicon)[ Packagist](https://packagist.org/packages/beyondcode/laravel-favicon)[ Docs](https://github.com/beyondcode/laravel-favicon)[ RSS](/packages/beyondcode-laravel-favicon/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (14)Used By (0)

Laravel Favicon
===============

[](#laravel-favicon)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7f85e448dedd0ae2b5b0b35b3ea3c2ceb46663896a6e486cae52de3a7f21db51/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6265796f6e64636f64652f6c61726176656c2d66617669636f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/beyondcode/laravel-favicon)[![Total Downloads](https://camo.githubusercontent.com/8e853763bc2abcc78ec3f2ac728b8369a8f78d7ab0bbfe4b6129c1fe07ce138b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6265796f6e64636f64652f6c61726176656c2d66617669636f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/beyondcode/laravel-favicon)

Create dynamic favicons based on your environment settings.

[![](https://camo.githubusercontent.com/a72956e89d1c94d3883e2f421e7cf29bbbdd966e6d766873058f6e9eb4c96402/68747470733a2f2f6265796f6e64636f2e64652f6769746875622f66617669636f6e732f73637265656e73686f742e706e67)](https://camo.githubusercontent.com/a72956e89d1c94d3883e2f421e7cf29bbbdd966e6d766873058f6e9eb4c96402/68747470733a2f2f6265796f6e64636f2e64652f6769746875622f66617669636f6e732f73637265656e73686f742e706e67)

Laravel Package Development
---------------------------

[](#laravel-package-development)

[![https://phppackagedevelopment.com](https://camo.githubusercontent.com/5dc18c4ff15fcc006449417087f3bffd562e2fc42d3729c95de9573d70cf2524/68747470733a2f2f6265796f6e64636f2e64652f636f75727365732f70687070642e6a7067)](https://phppackagedevelopment.com)

If you want to learn how to create reusable PHP packages yourself, take a look at my upcoming [PHP Package Development](https://phppackagedevelopment.com) video course.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require beyondcode/laravel-favicon
```

The service provider for this package will be automatically registered for you.

### Compatibility

[](#compatibility)

1.01.11.21.31.41.51.61.71.85.6.x✅✅✅✅✅✅✅✅❌5.7.x✅✅✅✅✅✅✅✅❌5.8.x❌✅✅✅✅✅✅✅❌6.x❌✅✅✅✅✅✅✅❌7.x❌❌✅✅✅✅✅✅❌8.x❌❌❌✅✅✅✅✅❌9.x❌❌❌❌❌✅✅✅❌10.x❌❌❌❌❌✅✅✅✅11.x❌❌❌❌❌❌✅✅✅12.x❌❌❌❌❌❌❌✅✅13.x❌❌❌❌❌❌❌❌✅Usage
-----

[](#usage)

To make use of this package, make use of the `favicon` helper function that this package provides.

You can simply wrap the function around your favicon icon names, like this:

```

```

### Customization

[](#customization)

You can completely customize which environments you want to have enabled for the favicon generation, as well as the font and colors that will be used.

To modify the default values, publish the package configuration file using:

```
php artisan vendor:publish --provider='BeyondCode\LaravelFavicon\FaviconServiceProvider' --tag='config'

```

This will publish the `config/favicon.php` file.

This is what the default content looks like:

```
return [

    /*
     * The list of enabled environments for the dynamic favicon
     * generation. You can specify the text to display as well
     * as the font and background color for the text.
     *
     * If no background color is specified, the text will be
     * on a transparent background.
     */
    'enabled_environments' => [
        'local' => [
            'text' => 'DEV',
            'color' => '#000000',
            'background_color' => '#ffffff',
        ],
    ],

    /*
     * The dynamic favicon text padding to apply.
     */
    'padding' => [
        'x' => 2,
        'y' => 2,
    ],

    /*
     * The font file to use for the dynamic favicon generation.
     * The default value will use OpenSans Regular.
     */
    'font' => null,

    /*
    * Intervention Image supports "GD Library" and "Imagick" to process images
    * internally. You may choose one of them according to your PHP
    * configuration. By default, PHP's "GD Library" implementation is used.
    *
    * If you want to convert ICO files, you need to use imagick.
    *
    * Supported: "gd", "imagick"
    *
    */
    'image_driver' => 'gd',

    /*
     * The prefix to use for the dynamic favicon URL.
     */
    'url_prefix' => 'laravel-favicon',

    /*
     * The favicon generator class to use. The default generator
     * makes use of the environment settings defined in this file.
     * But you can create your own favicon generator if you want.
     */
    'generator' => \BeyondCode\LaravelFavicon\Generators\EnvironmentGenerator::class,

];
```

Modify the settings to suit your needs.

Custom generator
----------------

[](#custom-generator)

The default favicon generator will write the text on the bottom-right corner of your favicon, in the desired color, font and background-color. If you want to generate a completely custom favicon, you can create your own FaviconGenerator implementation class and set it in the configuration file.

This is the interface that the generator should implement:

```
interface FaviconGenerator
{
    public function generate(string $icon): Response;

    public function shouldGenerateFavicon(): bool;
}
```

The `generate` method receives the icon url/filename and expects you to return an illuminate HTTP response.

The `shouldGenerateFavicon` method can be used to determine if a custom favicon should get generated.

FAQ
---

[](#faq)

### My ICO files are not working, why?

[](#my-ico-files-are-not-working-why)

In order to modify ICO files, you need the Imagick PHP library installed and enabled in your `config/favicon.php` file.

### Is there a performance impact when I'm using this package?

[](#is-there-a-performance-impact-when-im-using-this-package)

No - the default generator only modifies your favicon when the specified environment is enabled. This means, that production environments only see the static assets that you already have.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Marcel Pociot](https://github.com/mpociot)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance88

Actively maintained with recent releases

Popularity50

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~260 days

Recently: every ~167 days

Total

11

Last Release

59d ago

PHP version history (5 changes)1.0.0PHP ^7.1

1.4.0PHP ^7.1|^8.0

1.5.0PHP ^7.1|^8.0|^8.1|^8.2

1.6.0PHP ^7.1|^8.0|^8.1|^8.2|^8.3

1.8.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/863e91ca13b8c4031f202c0eee4f06b3a4352f92cf9cd397b03609b20247ed16?d=identicon)[beyondcode](/maintainers/beyondcode)

---

Top Contributors

[![dsbilling](https://avatars.githubusercontent.com/u/9788214?v=4)](https://github.com/dsbilling "dsbilling (25 commits)")[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (14 commits)")[![grafst](https://avatars.githubusercontent.com/u/8471055?v=4)](https://github.com/grafst "grafst (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (4 commits)")[![mechelon](https://avatars.githubusercontent.com/u/26432041?v=4)](https://github.com/mechelon "mechelon (4 commits)")[![rickyjohnston](https://avatars.githubusercontent.com/u/23019050?v=4)](https://github.com/rickyjohnston "rickyjohnston (2 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![gerpo](https://avatars.githubusercontent.com/u/11218560?v=4)](https://github.com/gerpo "gerpo (1 commits)")[![danielebarbaro](https://avatars.githubusercontent.com/u/4376886?v=4)](https://github.com/danielebarbaro "danielebarbaro (1 commits)")[![abejenaru](https://avatars.githubusercontent.com/u/1703377?v=4)](https://github.com/abejenaru "abejenaru (1 commits)")

---

Tags

faviconlaravelbeyondcodelaravel-favicon

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/beyondcode-laravel-favicon/health.svg)

```
[![Health](https://phpackages.com/badges/beyondcode-laravel-favicon/health.svg)](https://phpackages.com/packages/beyondcode-laravel-favicon)
```

###  Alternatives

[laravolt/avatar

Turn name, email, and any other string into initial-based avatar or gravatar.

2.0k5.4M31](/packages/laravolt-avatar)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
