svenluijten / env-providers Goto Github PK
View Code? Open in Web Editor NEW:construction_worker: Load Laravel service providers based on your application's environment.
Home Page: https://svenluijten.com
License: MIT License
:construction_worker: Load Laravel service providers based on your application's environment.
Home Page: https://svenluijten.com
License: MIT License
To make the package compatible with Laravel 9 Illuminate Support 9 needs to be added as well.
^8.0|^9.0
Hi @svenluijten I'm seeing a problem with package discovery in v3.1.2.
composer.json seems to be looking for "Sven\EnvProviders\EnvServiceProvider" while the actual service provider seems to have been renamed to ServiceProvider again.
I can put in a pull request to fix it, but I'm not sure which direction you want to take it so I figured I'd throw it in an issue and if you don't have time to work on it or just want to point me in a direction I should be able to put in a pull request for it.
Thanks,
-Ethan
This package needs integration tests, but I'm not too familiar with writing those yet. I'd appreciate any help(ful resources)!
Hey, composer will load all service provider classes in background!, that means only instantiation is remaining. Can we do kind of trick where only those classes will be loaded by composer which are specified in config
? This will help us in many ways. ๐
Right now, the configuration file seems a bit "messy", with top-level so-called "environment groups" and no real structure. This might be solved by introducing keyed environment groups. The current configuration file looks (something like) this:
return [
['environments' => ['local', 'dev', 'staging'], 'providers' => [/* ... */]],
['environments' => ['production'], 'providers' => [/* ... */], 'aliases' => [/* ... */]],
];
I propose a new syntax that would break BC, but could alleviate some confusion, and hopefully increase readability for newcomers coming into projects or this library:
return [
'local|dev|staging' => ['providers' => [/* ... */]],
'production' => ['providers' => [/* ... */], 'aliases' => [/* ... */]],
];
Using the pipe operator (|
) here for symmetry with Laravel and its validation, which is done in largely the same way. I also considered commas (,
), but that felt a bit too "foreign".
There might be a way to keep backwards compatibility by checking if the array (returned from config('providers')
) is associative. If it isn't, we just fall back to the current behaviour.
Your commit cf7ea2b broke backwards compatibility (you renamed \Sven\EnvProviders\EnvServiceProvider
to \Sven\EnvProviders\ServiceProvider
). But this commit was included in a minor update of your package. Version 3.1.0 should have been version 4.0.0.
Please follow semantic versioning in the future to prevent our applications to break.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.