Download the PHP package beyondcode/laravel-favicon without Composer
On this page you can find all versions of the php package beyondcode/laravel-favicon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download beyondcode/laravel-favicon
More information about beyondcode/laravel-favicon
Files in beyondcode/laravel-favicon
Package laravel-favicon
Short Description Create dynamic favicons based on your environment settings.
License MIT
Homepage https://github.com/beyondcode/laravel-favicon
Informations about the package laravel-favicon
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:
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 | |
---|---|---|---|---|---|---|---|
5.6.x | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
5.7.x | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
5.8.x | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
6.x | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
7.x | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
8.x | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
9.x | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
10.x | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
11.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:
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:
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:
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.
All versions of laravel-favicon with dependencies
illuminate/http Version 5.6.*|5.7.*|5.8.*|6.*|7.*|8.*|9.*|^10.0|^11.0
illuminate/support Version 5.6.*|5.7.*|5.8.*|6.*|7.*|8.*|9.*|^10.0|^11.0
intervention/image Version ^2.4