Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

laravel-favicon

> 后端框架
Open source

Create dynamic favicons based on your environment settings.

376 stars0 likes5 views
WebsiteGitHub

About

Create dynamic favicons based on your environment settings.

Laravel Favicon

Create dynamic favicons based on your environment settings.

Laravel Package Development

If you want to learn how to create reusable PHP packages yourself, take a look at my upcoming PHP Package Development video course.

Installation

You can install the package via composer:

bash
composer require beyondcode/laravel-favicon

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

Compatibility

1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8
5.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

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:

xml

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:

…

Modify the settings to suit your needs.

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:

php
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

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?

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

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

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

Credits

  • Marcel Pociot
  • All Contributors

License

The MIT License (MIT). Please see License File for more information.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPfaviconlaravel

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架