Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isaeken/envman
Manage Laravel environment variables runtime
https://github.com/isaeken/envman
Last synced: 2 days ago
JSON representation
Manage Laravel environment variables runtime
- Host: GitHub
- URL: https://github.com/isaeken/envman
- Owner: isaeken
- License: mit
- Created: 2022-09-18T16:11:28.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-09T01:18:27.000Z (about 1 year ago)
- Last Synced: 2024-05-02T21:29:51.124Z (7 months ago)
- Language: PHP
- Size: 30.3 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Manage your Laravel environment runtime
[![Latest Version on Packagist](https://img.shields.io/packagist/v/isaeken/envman.svg?style=flat-square)](https://packagist.org/packages/isaeken/envman)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/isaeken/envman/run-tests?label=tests)](https://github.com/isaeken/envman/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/isaeken/envman/Fix%20PHP%20code%20style%20issues?label=code%20style)](https://github.com/isaeken/envman/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/isaeken/envman.svg?style=flat-square)](https://packagist.org/packages/isaeken/envman)This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
## Support us
[](https://github.com/sponsors/isaeken)
Manage your Laravel application's environment variables dynamically so fast.
## Installation
You can install the package via composer:
```bash
composer require isaeken/envman
```You can publish and run the migrations with:
```bash
php artisan vendor:publish --tag="envman-migrations"
php artisan migrate
```You can publish the config file with:
```bash
php artisan vendor:publish --tag="envman-config"
```This is the contents of the published config file:
```php
return [
'enabled' => env('ENVMAN_ENABLED', true),'cache' => env('APP_ENV', 'production') === 'production',
'features' => [
// custom configs for domains
'domains' => true,
],'database' => [
'connection', env('DB_CONNECTION'),
],
];
```## Usage
You can change environment variables dynamically:
```php
\IsaEken\Envman\Facades\Envman::setConfig('app.name', 'Your App Name');
\IsaEken\Envman\Facades\Envman::setConfig('app.debug', false);
\IsaEken\Envman\Facades\Envman::setConfig('app.environment', 'production');
```And you can reset variables:
```php
\IsaEken\Envman\Facades\Envman::resetConfig('app.debug');
```## Commands
```shell
# Reset all your environment changes
php artisan envman:reset
``````shell
# Cache all environment variables
php artisan envman:cache
``````shell
# Clear all environment variable cache
php artisan envman:cache:clear
```## Testing
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [İsa Eken](https://github.com/isaeken)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.