- What does litalico-engineering/eg-r2 do in a Laravel app?
- eg-r2 is a Laravel package that generates request validation rules and routing code from a single definition. It reduces the manual work of keeping form requests, validation rules, and route registrations in sync. The generated output uses standard Laravel validation and routing APIs, so it fits into existing applications without a new runtime layer.
- How do I install eg-r2 with Composer?
- Run composer require litalico-engineering/eg-r2 in your Laravel project. The package's service provider is auto-discovered in typical Laravel versions. After installation, check the README for any publishable configuration or generator commands.
- Which Laravel and PHP versions does eg-r2 support?
- The exact constraints are declared in the package's composer.json, so read that file before adding it to an existing project. The package targets modern PHP 8.x runtimes and currently supported Laravel releases, but the require block is the authoritative source. If you are on an older Laravel version, verify compatibility or pin a release that matches your framework version.
- How do I configure eg-r2 after installation?
- Most Laravel packages of this type expose a config file you publish with php artisan vendor:publish. That config typically controls output paths, namespaces, and generation conventions. Consult the package README for the exact config key and any required environment variables.
- Can eg-r2 generate both validation rules and routes at the same time?
- Yes, the package's core purpose is to generate request validation rules and routing together from a shared definition. That keeps route parameters and validation constraints consistent. Review the generated files before committing them, since generation is a development-time step.
- Does eg-r2 replace Laravel's built-in validation or routing?
- No. eg-r2 generates code that uses Laravel's native validator and router, so the framework still handles requests and route dispatch at runtime. It is a development helper, not a replacement for Laravel's HTTP layer. You can remove the package without changing how the generated code runs.
- How do I test the validation rules and routes generated by eg-r2?
- Use Laravel's standard HTTP tests to assert route responses and validation errors. Because the output is plain Laravel code, you can test it with the same assertions you use for hand-written form requests and routes. Add a generation step to CI only if you want to verify that committed output stays in sync.
- Is eg-r2 safe to use in production?
- Generated validation rules and routes are ordinary PHP files, so production runtime does not depend on the generator itself. Review generated diffs before deploying and keep the package in require-dev if you only run it locally or in CI. Pin a specific version to avoid unexpected changes in generated output.
- What are alternatives to eg-r2 for generating Laravel validation and routes?
- Laravel's built-in make:request command, manual route files, and validator rules cover the same ground without an extra dependency. Other code-generation or CRUD packages may also produce requests and routes. Choose eg-r2 if its combined validation-and-routing generation matches your workflow better than those options.
- Who maintains eg-r2 and how active is the project?
- The package is maintained by LITALICO Engineering and published on GitHub as litalico-engineering/eg-r2. Check the repository's releases, open issues, and commit history to judge release cadence and support. For long-lived projects, pin a tested version and review upgrade notes before moving to newer releases.