achinon/yaml_classer
Symfony bundle that converts YAML config files into generated PHP classes, enabling IDE-friendly, callable access to YAML values. Install via Composer, run a console command to generate a class, then use via DI or instantiate directly.
Symfony\Component\Yaml\Yaml and config caching. This package adds value only if IDE tooling (e.g., autocompletion, static analysis) is a priority over runtime performance.config/) typically uses PHP arrays, not YAML. Forcing YAML may introduce inconsistency.config:cache).composer require achinon/yaml_classer.bin/console command (if Symfony Console is available) or wrap the logic in a Laravel Artisan command.bind() in a service provider:
$this->app->bind(ExampleConfig::class, function () {
return new ExampleConfig();
});
php artisan yaml:classer example_config.yml ExampleConfig
app/ or a Generated/ directory (excluded from Git if auto-generated).post-update Git hook or CI step to regenerate classes on YAML changes.- run: php artisan yaml:classer config/thirdparty.yml ThirdPartyConfig
Config).Illuminate\Support\Facades\Config).Yaml::parse()).achinon/yaml_classer (though low-star packages may lack maintenance).assert or custom assertions).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| YAML syntax errors | Broken generated classes | Validate YAML before generation (e.g., Yaml::parse()). |
| Missing class regeneration | Stale classes in production | Automate in CI/CD with pre-deploy checks. |
| Namespace/class name collisions | Runtime errors | Use unique prefixes (e.g., App\Generated\). |
| IDE misconfiguration | Poor autocompletion | Document IDE setup in team wiki. |
| Package abandonment | Unmaintained library | Fork or replace with a maintained alternative. |
How can I help you explore Laravel packages today?