Download the PHP package intrfce/laravel-environment-banner-bext without Composer

On this page you can find all versions of the php package intrfce/laravel-environment-banner-bext. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-environment-banner-bext

Laravel Environment Banner

Introduction

Laravel Environment Banner publishes information about the running application into a single <meta> tag, allowing a browser extension to display a banner that makes it obvious which environment, which application, and which git worktree you are looking at. The package renders the tag; deciding what the banner looks like is the responsibility of the extension reading it.

Installation

You may install Laravel Environment Banner using the Composer package manager:

The package's service provider is registered automatically via package discovery.

Configuration

The package works without any configuration. If you wish to customise it, you may publish the configuration file using the vendor:publish Artisan command:

This command will place an environment-banner.php file within your application's config directory.

Rendering the Banner

Place the @envBanner Blade directive within the <head> element of your application's layout:

The directive renders a single meta tag named if-env-info, whose content is the banner data encoded as JSON:

The JSON is escaped for use within an HTML attribute, so values containing quotes are safe to publish.

If you need the same data elsewhere, such as an Inertia prop or an API response, you may resolve the EnvironmentBanner class from the container and call its toArray method:

[!WARNING] The directive renders in every environment, including production, so your application's name and environment will appear in the HTML of every page that includes it. If you do not want this, wrap the directive in an @production check or a condition of your own.

Banner Data

The meta tag always contains the environment, app, and worktree keys. The colour and extra keys are only included once you have configured them.

Environment and Application Name

The environment and app keys are read from your application's existing configuration, using config('app.env') and config('app.name') respectively. No further setup is required.

Worktrees

When you serve more than one checkout of the same application, such as when using git worktrees, the environment and application name are identical in each one. To tell them apart, define the ENV_WORKTREE_NAME environment variable within the .env file of a given checkout:

The value is published as the worktree key. Checkouts without this variable publish null.

Colours

To suggest a colour for the banner, define the colour configuration value as a three or six digit hex string:

Colours are normalised to lowercase, six digit form before they are published, so the value above is rendered as #ff0000. Values that are not valid hex colours throw an InvalidColourException.

If you would like the colour to vary by environment, you may provide an array keyed by environment name instead:

The optional default key is used for any environment that is not listed. Without it, unlisted environments publish no colour at all:

An exact environment match always takes precedence over the default key. To publish no colour for a particular environment while still using a default for the rest, set that environment to null:

Every colour in the array is validated, not only the one belonging to the current environment, so a mistyped production colour surfaces while you are working locally rather than after you deploy.

Extra Data

You may publish additional key / value pairs for the banner to display, such as the current branch or the release currently deployed. Typically, you should register this data within the boot method of your application's AppServiceProvider class:

The data is published under the extra key:

Repeated calls to the extraData method are merged, with later keys replacing earlier ones, so several service providers may each contribute their own data. You may inspect the registered data using the getExtraData method, and discard it using the flushExtraData method.

Only string keys and string values are accepted; anything else throws an InvalidExtraDataException. Values should be cast before they are registered:

[!NOTE] PHP casts numeric string keys to integers, so a key such as '1' becomes an integer and is rejected. Prefix keys of this kind so that they remain strings.

License

Laravel Environment Banner is open-sourced software licensed under the MIT license.


All versions of laravel-environment-banner-bext with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package intrfce/laravel-environment-banner-bext contains the following files

Loading the files please wait ...