EnvSync V1.1.0 – Robust Required Field Validation & Full .env Synchronization for Laravel & Standalone PHP
LatestThis release introduces critical fixes and exciting new features designed to streamline and enhance your environment variable management. Key updates include:
1. Critical Fix:
- Required field validation now fully supports both array and string rule formats, ensuring consistency in field validation for missing required environment variables.
- This fix ensures that rules like
['required', 'string']work seamlessly, just asrequired|stringdid previously. Missing required environment variables will now be detected and reported correctly.
2. New Features:
- Environment File Synchronization: A complete solution for keeping
.envand.env.examplefiles synchronized, preventing discrepancies between your local environment and production. - EnvExampleSyncService: This service intelligently categorizes environment variables and includes built-in security features, such as automatic sensitive data masking and smart example value generation.
- New Command: The new
php artisan env:synccommand offers multiple options (--check,--force,--no-values,--remove-extra) to give you full control over the synchronization process. - New Facade: The
EnvSyncfacade makes it easy to programmatically integrate environment synchronization into your Laravel or standalone PHP applications.
3. Security Enhancements:
- Automatic handling of sensitive data, ensuring that secret values are masked and never exposed in example files.
- Smart generation of example values that provide realistic, but non-sensitive, defaults for your environment configuration.
4. Documentation Improvements:
- Enhanced README with clear examples and usage guidelines, including new sections for Environment File Synchronization and Required Field Validation.
- Comprehensive example files and test cases to ensure smooth integration and usage across different project structures, including standalone PHP applications.
5. New Examples & Tests:
- New example files demonstrating best practices, including required field validation and environment synchronization in real-world scenarios.
- 28 tests to validate synchronization functionality, error handling, and edge cases, ensuring a robust and reliable release.
This release is ideal for developers looking to improve the consistency of their environment variable handling and validate required fields more effectively. Whether you're working in a Laravel application or a standalone PHP setup, this update provides the tools and flexibility to keep your environments in sync and your validation rules working as expected.