laramicstudio/env-guard
最新稳定版本:1.60.0
Composer 安装命令:
composer require laramicstudio/env-guard
包简介
It lets you define a schema for your .env file — think of it like a contract. When your app boots, it checks your actual .env against that contract and fails loudly and early if something is wrong.It lets you define a schema for your .env file — think of it like a contract. When your app boots, it c
README 文档
README
ENV-GUARD
lets you define a schema for your .env file — think of it like a contract. When your app boots, it checks your actual .env against that contract and fails loudly and early if something is wrong.
composer require laramicstudio/env-guard
You can publish the config file with:
php artisan vendor:publish --tag="env-guard-config"
If you are installing on a already existing project you can run the command
php artisan env:check
This is the contents of the published config file:
return [ 'log_rejections' => false, 'log_channel' => 'stack', 'rules' => [ 'APP_KEY' => 'required|string', 'APP_ENV' => 'required|in:local,staging,production', 'DB_PASSWORD' => 'required|string|min:8', 'STRIPE_SECRET' => 'required|starts_with:sk_', 'CACHE_TTL' => 'required|integer|min:1', 'MAIL_PORT' => 'nullable|integer', ], ];
Usage
$envGuard = new LaramicStudio\EnvGuard(); $envGuard->validate();
Testing
composer test
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-09
