{"id":15067147,"url":"https://github.com/izica/laravel-env-secure","last_synced_at":"2025-06-17T07:32:44.682Z","repository":{"id":232062841,"uuid":"783372911","full_name":"izica/laravel-env-secure","owner":"izica","description":"Safe and secured with encryption Laravel env (environment) variables with zero dependencies","archived":false,"fork":false,"pushed_at":"2024-04-08T10:49:44.000Z","size":161,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T01:37:29.034Z","etag":null,"topics":["decryption","ecnrypt","env","environment","environment-variables","laravel","laravel-framework","safe-settings","safety","secure","secure-coding","security","zero-dependency"],"latest_commit_sha":null,"homepage":"https://github.com/izica/laravel-env-secure","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/izica.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-07T17:59:17.000Z","updated_at":"2024-04-08T12:34:14.000Z","dependencies_parsed_at":"2024-04-07T19:23:43.956Z","dependency_job_id":"52ebdb2f-e6bc-4094-b1d3-8002d7f7c4d1","html_url":"https://github.com/izica/laravel-env-secure","commit_stats":null,"previous_names":["izica/laravel-env-secure"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/izica/laravel-env-secure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izica%2Flaravel-env-secure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izica%2Flaravel-env-secure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izica%2Flaravel-env-secure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izica%2Flaravel-env-secure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/izica","download_url":"https://codeload.github.com/izica/laravel-env-secure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izica%2Flaravel-env-secure/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260313803,"owners_count":22990472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decryption","ecnrypt","env","environment","environment-variables","laravel","laravel-framework","safe-settings","safety","secure","secure-coding","security","zero-dependency"],"created_at":"2024-09-25T01:17:14.285Z","updated_at":"2025-06-17T07:32:44.641Z","avatar_url":"https://github.com/izica.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel env secure\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/izica/laravel-env-secure.svg?style=flat-square)](https://packagist.org/packages/izica/laravel-env-secure)\n\nPRs are welcome\n\n## Description\nSimple Laravel package with zero dependencies for securing your env values, such as database passwords or API keys, to prevent exposure($_ENV or $_SERVER) due to mistakes\n\n## Prerequisites\nThis package using https://www.php.net/manual/en/ref.openssl.php\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require izica/laravel-env-secure\n```\n\n## Publish config(optional)\n\n```bash\nphp artisan vendor:publish --provider=\"Izica\\\\EnvSecure\\\\EnvSecureServiceProvider\"\n```\n\n## Usage\n\n#### 1. Encrypt env value\n```php\nphp artisan env:secure {env key} {--cli} {--decrypt}\n```\nOptions:\n* --cli - only print result in console don't rewrite .env\n* --decrypt - decrypt env value\n\nExample:\n```php\nphp artisan env:secure DB_PASSWORD\n```\n\n*Your env file will change*\nfrom:\n```env\nDB_PASSWORD=somepassword\n```\n\nto:\n```env\nDB_PASSWORD=scr::zvzEOZDAE4k/7D/rx\n```\n\n#### 2. Change config to\n\n```php\n//config/database.php\n\nuse \\Izica\\EnvSecure\\EnvSecure;\n\n[\n    //...\n    'connections' =\u003e [\n         //...\n        'mysql' =\u003e [\n            //...\n            'password' =\u003e EnvSecure::env('DB_PASSWORD', ''),\n        ]\n    ]\n]\n```\n\n## Config\n\n```php\n//config env-secure.php\nreturn [\n    \"prefix\"    =\u003e env('ENV_SECURE_PREFIX', 'scr::'),\n    \"algorithm\" =\u003e env('ENV_SECURE_ALGORITHM', 'AES-128-CTR'),  // https://www.php.net/manual/en/function.openssl-get-cipher-methods.php\n    \"iv\"        =\u003e env('ENV_SECURE_IV', 1234567891011121),\n    \"key\"       =\u003e env('ENV_SECURE_KEY', null), //APP_KEY by default. If you change the key after the values have been secured, you will not be able to decrypt the values in the future.\n];\n```\n\n#### Security recommendations\nSet the key directly in the file, like: \n\n```php\n//config env-secure.php\nreturn [\n   //...\n    \"key\" =\u003e \"kovdj43ksadjl32jlk\"\n];\n```\n\n## Credits\n\n-   [izica](https://github.com/izica)\n-   [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizica%2Flaravel-env-secure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fizica%2Flaravel-env-secure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizica%2Flaravel-env-secure/lists"}