You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using this SDK inside a laravel project, the package fails to read the env variables if you run the config:cache command.
It's only able to pick the MPESA secret and keys after running config:clear Which is weird because we need to be able to cache our configurations to improve on performance.
I have used the package in a couple of projects, great work. I always run config:cache and it messes me up big time.
The text was updated successfully, but these errors were encountered:
@jaymoh , this isn't a bug, it is actually the expected behavior.
When you run config:cache on a laravel app it caches the app configuration to improve performance.
Once the configuration has been cached, the .env file will not be loaded and calls to the env() helper will only return system-level environment variables.
A configuration management best practice is to use the env() helper only inside config files. That way your environment variables will be cached as you expect. i.e
add an mpesa.php config file and in it read the values with the env() helper
Then update your code to reference the config values with the config() helper
When using this SDK inside a laravel project, the package fails to read the env variables if you run the config:cache command.
It's only able to pick the MPESA secret and keys after running config:clear Which is weird because we need to be able to cache our configurations to improve on performance.
I have used the package in a couple of projects, great work. I always run config:cache and it messes me up big time.
The text was updated successfully, but these errors were encountered: