lukasmu / laravel-favicon
Add pretty favicons to your Laravel application on the fly
Fund package maintenance!
lukasmu
Requires
- php: ^8.2
- chrisjean/php-ico: ^1.0
- illuminate/console: ^11.0||^12.0
- illuminate/http: ^11.0||^12.0
- illuminate/support: ^11.0||^12.0
- intervention/image: ^2.5
- symfony/http-foundation: ^7.0
Requires (Dev)
- larastan/larastan: ^3.1
- laravel/pint: ^1.14
- orchestra/testbench: ^9.0||^10.0
- pestphp/pest: ^3.7
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.1
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- symfony/dom-crawler: ^7.0
README
This package can be used to quickly generate customized and high-quality favicons for your Laravel application. The icons are generated on the fly for different platforms and display resolutions. Usage is super simple and just requires including a view component in your Blade templates.
Installation
You can install the package via composer:
composer require lukasmu/laravel-favicon
Usage
Add the <x-favicon::links />
view component to the head section of your Blade templates:
<!doctype html> <html> <head> <title>Example</title> <x-favicon::links /> ... </head> <body> ... </body> </html>
When you use this package to production environments it is recommended invoke the following command to cache the most commonly requested favicons:
php artisan favicon:cache
You can undo the above command by invoking:
php artisan favicon:clear
Customization
You may publish the favicon.php
config file with:
php artisan vendor:publish --provider="LukasMu\Favicon\FaviconServiceProvider" --tag="config"
Feel free to set the appropriate environmental variables (or edit the config file) in order to customize the automatically generated favicons.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contributions are welcome and will be fully credited. Feedback is very much appreciated as well.
Please see CONTRIBUTING for details.
Testing
The package includes tests written for the Pest PHP testing framework which can be run by calling:
composer test
Security
If you discover any security related issues, please email hello@lukasmu.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see LICENSE for more information.