Requires PHP Imagick
You can install the package via composer:
composer require magarrent/favicon-generator
To use your own image and convert it to the different favicons versions, use these methods. This will generate a "favicon" folder to your public_path with the different favicons formats and versions. Will also generate some XML and webmanifest according to the web standards.
Use this methods in your own scenario, when you upload the image, or just a console command, whatever.
Just write your input path and optionally the public output path.
If you don't specify the output (2nd param), the favicons will be saved in public/favicons
$favicon = new FaviconGenerator('path-to-your-image', 'optional-public-dist-path');
$favicon->generateFaviconsFromImagePath();
Once you generated the icons, just write these line into your <head>
section of your HTML
{!! \Magarrent\FaviconGenerator\FaviconGenerator::generateHtmlMetaIcons() !!}
composer test
Please see CHANGELOG for more information on what has changed recently.
- Tests
- Generate icons from Image class, not from String path
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.