patrick-cullen/env-title

A Laravel package for adding the environment to the HTML title

v1.0.11 2024-05-21 00:27 UTC

This package is auto-updated.

Last update: 2024-05-21 00:28:18 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Ever had local, QA, and production tabs of the same application all open at the same time? It can be easy to mix them up and waste precious time and attention keeping them straight.

This utility package creates a blade component that prepends the HTML document title (what shows in a browser tab) with the environment that the application is running in- unless it's production, in which case it is treated as a regular <title> tag.

Installation

You can install the package via composer:

composer require patrick-cullen/env-title

Note that you may need to add the -W flag if a dependency of env-title such as "spatie/laravel-package-tools" is required by other packages in your project and is installed at a version below the required versions for env-title. Alternatively, run:

composer update

before installing this package via composer.

The installation script will handle the rest:

php artisan env-title:install

Now just replace your <title> tags with <x-env-title> blade components, and you're good to go.

Workflow for making changes to this package

  • Pick a project to pull this package into
composer require patrick-cullen/env-title --prefer-source
  • Tinker around and commit desired changes to version control (this is what the --prefer-source flag allows you to do).
  • Push your changes.
    • If you see multiple remotes (origin and composer) don't worry - updating one will update the other momentarily.
  • Tag and push your changes - in a more refined workflow you would probably want to add a stability flag for anything not thoroughly tested and used by others, but standard semver should suffice.

Credits

License

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