LaravelPackages.net
Acme Inc.
Toggle sidebar
hedger/laravel-envicon

Use a different favicon depending on your current runtime environment

3.261
19
v2.0
About hedger/laravel-envicon

hedger/laravel-envicon is a Laravel package for use a different favicon depending on your current runtime environment. It currently has 19 GitHub stars and 3.261 downloads on Packagist (latest version v2.0). Install it with composer require hedger/laravel-envicon. Discover more Laravel packages by hedger or browse all Laravel packages to compare alternatives.

Last updated

Laravel Envicon

Support Laravel versions Latest Version on Packagist Software License GitHub Workflow Status

This package allows you to display a custom favicon depending on your runtime environment. This makes it easy to identify immediately on which environment you're browsing.

Install

Via Composer

composer require hedger/laravel-envicon

Once the package is installed, you'll need to publish the configuration to link your environments to custom favicons.

php artisan vendor:publish --tag=envicon-config

If you want to use the default envicons provided by this package, run the following command that will copy them in your public/favicons folder.

php artisan vendor:publish --tag=envicon-favicons

Usage

Simply use the provided helper in place of your favicon's URL. This will return the favicon that matches your current runtime environment.

<!doctype html>
<html lang="en">
    <head>
        <link rel="icon" href="{{ Envicon::url() }}">
    </head>
</html>

If you need the URL of a favicon for a specific environment, use the following statement instead. You'll need to pass the environment's name as the first parameter.

<!doctype html>
<html lang="en">
    <head>
        <link rel="icon" href="{{ Envicon::for('production') }}">
    </head>
</html>

Testing

Tests can be run using the following composer script.

composer test

License

The MIT License (MIT). Please see License File for more information.

Star History Chart