lukasmu/laravel-favicon

Add pretty favicons to your Laravel application on the fly

v2.0.0 2025-02-25 19:04 UTC

This package is auto-updated.

Last update: 2025-02-25 19:07:21 UTC


README

Latest Version on Packagist GitHub Run Tests Action Status GitHub Format Code Action Status Coverage Status Total Downloads

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.