infinety-es/custom-providers

Load custom Laravel service providers

1.0 2016-06-09 11:14 UTC

This package is auto-updated.

Last update: 2024-05-12 21:51:12 UTC


README

Latest Version on Packagist Total Downloads Software License StyleCI

This package allows you to configure the environment certain service providers and aliases are loaded in.

Installation

Via composer:

$ composer require infinety-es/custom-providers

Or add the package to your dependencies in composer.json and run composer update to download the package:

{
    "require": {
        "infinety-es/custom-providers": "^1.0"
    }
}

Next, add the CustomServiceProvider to your providers array in config/app.php:

// config/app.php
'providers' => [
    ...
    Infinety\CustomProviders\CustomServiceProvider::class,
];

Usage

You must publish this package's configuration file for it to work correctly. To do so, run the following command:

$ php artisan vendor:publish --provider="Infinety\CustomProviders\CustomServiceProvider"

After that, you should have see the file config/providers.php.

Environments

In the environments array you can define what environments the provider group should respond to. You may use an asterisk (*) to make that group's providers and aliases load regardless of the application's environment.

Note: You can set your application's environment in either config/app.php under env or via your .env file.

Providers

The providers array is where you can put the providers you want to have loaded in the defined environments. This should be pretty straight forward as it is the same as how you would register service providers in config/app.php.

Aliases

In the aliases array you may put all the aliases (facades) you want to register.

As with the providers, this is the same as how you would register aliases in the default config/app.php configuration file.

Contributing

All contributions (in the form on pull requests, issues and feature-requests) are welcome. See the contributors page for all contributors.

License

MIT License (MIT). Please see the license file for more information.