百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

laravel-favicon

> 后端框架
开源

根据环境设置创建动态收藏夹图标。

376 stars0 点赞5 次浏览
访问官网GitHub

工具介绍

根据环境设置创建动态收藏夹图标。

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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHPfaviconlaravel

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类后端框架
定价开源

> 相关工具

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