mesingh/laravel-env-packages

This package lets you define various package requirements according to the environment.
7 1
Install
composer require mesingh/laravel-env-packages
Latest Version:v1.0.0-beta
PHP:~5.6|~7.0
Laravel:5
License:MIT
Last Updated:Mar 18, 2018
Links: GitHub  ·  Packagist
Maintainer: meSingh

Laravel Environment Specific Packages

Latest Version on Packagist Software License

This package lets you define various package requirements according to the environment.

Install

Via Composer

$ composer require mesingh/laravel-env-packages

Then add the service provider in config/app.php:

meSingh\EnvPackages\EnvPackagesServiceProvider::class,

Then publish vendor files for access the configuration file:

$ php artisan vendor:publish --provider="meSingh\EnvPackages\EnvPackagesServiceProvider"

Usage

You need to run envpackages:generate command after each configuration update.

$ php artisan envpackages:generate

Configuration

envpackages.php file is used to define any package requirements that are loaded over some specific environment like you might have some development packages installed that you do not wish to load over production and/or staging.

You can define any requirement in any environment. So to define a provider for the local environment, you just need to add it like this:

'providers' => [
    'local'  => [
        Provider\Package\SomeServiceProvider::class,
    ],
],

In case you need to load this provider in multiple environments like local, testing and development, you can do so like this:

'providers' => [
    'local,testing,development'  => [
        Provider\Package\SomeServiceProvider::class,
    ],
],

You can also do any kind of combinations in configuration like this:

'providers' => [
    'local,testing,development'  => [
        Provider\Package\SomeServiceProvider::class,
    ],
    'development'  => [
        Provider\Package\OtherServiceProvider::class,
    ],
    'staging,production'  => [
        Provider\Package\AnotherServiceProvider::class,
    ],
],

License

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

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

593,882,149 34,959
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

399,241,428 4,660

Version History

Pre-releases (1)
Version Released PHP Laravel License
v1.0.0-beta ~5.6|~7.0 ~5 MIT