Skip to content

EnvSync V1.1.0 – Robust Required Field Validation & Full .env Synchronization for Laravel & Standalone PHP

Latest

Choose a tag to compare

@dev-kraken dev-kraken released this 27 May 13:38

This 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 as required|string did previously. Missing required environment variables will now be detected and reported correctly.

2. New Features:

  • Environment File Synchronization: A complete solution for keeping .env and .env.example files 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:sync command offers multiple options (--check, --force, --no-values, --remove-extra) to give you full control over the synchronization process.
  • New Facade: The EnvSync facade 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.