Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.8] Add Env class #28061

Closed
wants to merge 2 commits into from
Closed

[5.8] Add Env class #28061

wants to merge 2 commits into from

Conversation

kawax
Copy link
Contributor

@kawax kawax commented Mar 29, 2019

laravel/ideas#1580

Still no breaking change.
This is for users who do not want to use env().

<?php

use Illuminate\Support\Env;

return [
    'name' => Env::get('APP_NAME', 'Laravel'),
];

future plan

  • Replace all env()
  • Deprecate env() and move to laravel/helpers

@driesvints driesvints changed the title Add Env class [5.8] Add Env class Mar 29, 2019
@jmarcher
Copy link
Contributor

Why? What is the problem with env() ? Why would someone not use env() but somehow Env::get()?

@kawax
Copy link
Contributor Author

kawax commented Mar 29, 2019

env() is likely to conflict with other packages.
Same function, but a slightly different spec.

@taylorotwell
Copy link
Member

Maybe for 5.9.

@kawax kawax deleted the env branch March 30, 2019 15:58
@kawax kawax mentioned this pull request Mar 30, 2019
@mfn
Copy link
Contributor

mfn commented Apr 9, 2019

@kawax FWIW, I support your basic idea, thanks 👍

I personally have been bitten by this, integrating legacy code with Laravel which also used a env() global function which however worked differently 💥

@driesvints
Copy link
Member

@mfn this got added on master: #28073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants