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

Refactor Paystack Configuration to Use env() for Environment Variables #189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abbeymichael
Copy link

This pull request refactors the Paystack Laravel package configuration to use the env() function instead of getenv() for retrieving environment variables. This change was made to resolve an issue encountered in the production environment.

Changes:

Replaced getenv calls with env() in the paystack.php configuration file to fetch environment variables.

Reason for the Change:

Issue with getenv() in Production: The original implementation using getenv() was not loading environment variables correctly in the production environment. This caused issues such as the error "URI must be a string or UriInterface," as the required configuration values were not properly retrieved.
env() for Consistency: Using env() aligns with Laravel’s recommended practices for accessing environment variables. It ensures that values are correctly loaded from the .env file and properly utilized in the application.
Configuration Caching: The env() function allows Laravel to cache configuration settings, improving performance and ensuring that environment-specific values are consistently available across different environments.

This refactor addresses the issue of environment variable loading and ensures that the Paystack configuration works reliably in both development and production environments.

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.

1 participant