GithubHelp home page GithubHelp logo

royalwang / env-providers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from svenluijten/env-providers

0.0 3.0 0.0 20 KB

:package: :construction_worker: Load Laravel service providers based on your application's environment.

Home Page: https://svenluijten.com

License: MIT License

PHP 100.00%

env-providers's Introduction

env-providers

Laravel EnvProviders

Latest Version on Packagist Total Downloads Software License Code Climate Code Quality SensioLabs Insight StyleCI

A more finetuned way of managing your service providers in Laravel. This package allows you to configure the environment certain service providers and aliases are loaded in.

Installation

Via composer:

$ composer require sven/env-providers

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

{
    "require": {
        "sven/env-providers": "^3.0"
    }
}

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

// config/app.php
'providers' => [
    ...
    Sven\EnvProviders\EnvServiceProvider::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="Sven\EnvProviders\EnvServiceProvider"

After that, you should have see the file config/providers.php. In the created configuration file you can see 2 pre-defined provider groups that will help you set up what providers and aliases should be loaded when the application is in a certain environment.

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. If you want to manage your .env file via php artisan, you can check out sven/flex-env.

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

sven/env-providers is licenced under the MIT License (MIT). Please see the license file for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.