- What does myaza-software/schema-validator do in a Laravel application?
- Schema Validator for Laravel validates arrays and request data against defined schemas. It is designed to catch structural errors early and return clear messages when data does not match the expected shape. The package is described as lightweight and configurable, making it useful for enforcing consistent data structures across your application.
- How do I install myaza-software/schema-validator with Composer?
- Install the package with Composer using composer require myaza-software/schema-validator. After installation, follow the package README for any service provider registration or configuration publishing steps. If the package ships a config file, publish it according to the README and define your schemas there.
- Can Schema Validator validate Laravel request data?
- Yes. The package is intended to validate arrays and request data against defined schemas. You can use it alongside Laravel's built-in validation when you need to enforce the overall shape of a payload, not just individual field rules. Check the README for the exact integration points in your request flow.
- How are schemas defined for array validation?
- Schemas describe the expected structure that an array or request payload must match. The exact schema syntax and supported rules are documented in the package README, so review that before defining production schemas. Keeping schemas close to the code or configuration that owns the data helps keep validation consistent.
- Which Laravel versions are supported by myaza-software/schema-validator?
- The provided overview does not list specific Laravel version constraints. Confirm supported versions in the package's composer.json and README before adopting it. In general, match the package's illuminate/support constraint to the Laravel version used by your application.
- Can I validate an API payload before mapping it to a DTO?
- The package focuses on validating array and request data against defined schemas, which makes it suitable as a pre-check before mapping a payload to a DTO. Validating the structure first helps catch missing keys or unexpected shapes before your mapping code runs. Review the README for the recommended mapping and validation workflow.
- How do I test schema validation in Laravel feature tests?
- Write feature tests that send representative payloads through your request flow and assert the response or exception produced for invalid schema data. Include cases for missing keys, incorrect types, and nested structures. Once you confirm the exact message wording, you can assert message fragments as well.
- Is Schema Validator lightweight enough for production use?
- The package is described as lightweight and configurable, but production suitability depends on your schema complexity and request volume. Keep schemas focused, avoid duplicating validation already handled by Laravel's validator, and test with realistic payloads in staging. This helps confirm performance and error-handling behavior before rollout.
- How is this different from Laravel's built-in validator?
- Laravel's validator is built around field-level rules such as required, string, or email. Schema Validator focuses on validating an array or request payload against a defined schema to enforce its overall structure. The two can complement each other when you need both field rules and structural checks.
- Who maintains myaza-software/schema-validator and where do I report issues?
- The package is published under the myaza-software vendor name, and the repository is hosted at github.com/myaza-software/schema-validator. Use the repository's issue tracker for bugs and feature requests, and review its releases and README for maintenance activity. Checking recent commits and open issues is a good way to assess project health before adopting it.