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

.env not working? #85

Closed
mprandot opened this issue Nov 22, 2017 · 3 comments
Closed

.env not working? #85

mprandot opened this issue Nov 22, 2017 · 3 comments

Comments

@mprandot
Copy link

Hello!

I set a APP_ENV in my .env created in project root, and this always returns null.

dd(env('APP_ENV'));

Someone can reproduce this?

@nunomaduro
Copy link
Member

@mprandot The DotEnv PHP library is not included on Laravel Zero. Give me some minutes to think about this.

@mprandot
Copy link
Author

mprandot commented Nov 23, 2017

Ah, no problem! I've found in a illuminate Helper class that has a env method, then i thinked "i can use it" 😄
I create a env.php in config folder, then i use config('env.<array_index_name>'), it's working now

@TNovalis
Copy link

I don't think we should be using a .env for Laravel-Zero. I would recommend just doing something like the following:
config/filesystems.php

return [
    'default' => env('FILESYSTEM_DRIVER', 'local'),
    'disks' => [
        'local' => [
            'driver' => 'local',
            'root' => $_SERVER['HOME'].'/.your-project',
        ],
    ],
];

This way you can just use the Storage facade to put files where you need them. This is similar to how composer handles user configuration (albeit without the fancy facade of course.)

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

No branches or pull requests

3 participants