Skip to content

vars in .env sometimes returns null #3992

Closed
@luispastendev

Description

@luispastendev

I don't know why this behavior is caused but sometimes the variables saved in the codeigniter .env file return null

I am trying to test a class and it stopped working because it started to return null, the strange thing is that in other parts of the application I call the variable in the same way and there is no problem

for example:

my class:

   private $refreshSecret;
   public function __construct(Academy $configs){
        $this->refreshSecret = env('jwt.secretRefresh');
   }

my .env file

jwt.secretRefresh = 'super_secret';

When I run my test it fails because the environment variable returns null, I had long ago noticed that error in another project where I used the env ('CI_ENVIRONMENT') which in the same way did not return the configured environment.

I hope someone knows something about this problem :(

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions