- How do I enable verbose validation reports in Laravel without manually calling ->verbose()?
- Set `VERBOSE_VALIDATOR_ENABLED=true` in your `.env` or rely on the default behavior, which ties verbose mode to `APP_DEBUG=true`. The package auto-discovery handles the rest—no manual configuration is needed unless you want to customize the failure report type.
- Will this package slow down my production API responses?
- Only if you enable verbose mode in production. By default, it’s disabled when `APP_DEBUG=false`. Even if enabled, the overhead is minimal unless you’re validating thousands of records per second—benchmark your specific use case to confirm.
- Can I use Laravel Verbose Validator with Form Requests?
- Yes, but you’ll need to manually chain `->verbose()` to the validator instance inside your `FormRequest::failedValidation()` method or override the `validate()` method to include it. The package doesn’t auto-inject into Form Requests by default.
- Does this work with custom validation rules or only Laravel’s built-in rules?
- It works with all validation rules, including custom ones. The package hooks into Laravel’s core `Validator` class, so it captures every rule—whether it’s `required`, `email`, or a custom rule like `unique:users,email`.
- How do I customize the verbose report output format?
- The package doesn’t expose direct formatting options, but you can access the raw report via `$validator->getReport()` and format it as needed. For structured output (e.g., JSON), process the array before returning it to the user or logging it.
- Is there a way to log verbose validation reports to a file or monitoring system?
- Yes, retrieve the report with `$validator->getReport()` and log it using Laravel’s logging system (`Log::info()`) or a third-party service like Sentry. The report is a structured array, making it easy to serialize and store.
- What Laravel versions are officially supported, and are there breaking changes between them?
- The package supports Laravel 8–12 with no breaking changes across versions. However, if you’re using Laravel 8.x, ensure your custom validation logic doesn’t rely on features introduced in later versions, as the package itself remains consistent.
- Can I disable verbose mode for specific validators while keeping it enabled globally?
- Yes, globally enable it via config/env, then override for specific cases by omitting `->verbose()` on those validators. The package respects per-validator opt-outs while maintaining global defaults.
- How do I handle localization for verbose validation messages?
- The package doesn’t override Laravel’s existing localization system. If your validation messages are already localized (e.g., in `resources/lang`), the verbose reports will inherit those translations automatically. No additional setup is required.
- Are there alternatives to this package for debugging Laravel validation?
- Yes, you could manually log validation steps using Laravel’s `Validator::extend()` or third-party packages like `spatie/laravel-validation-extensions`. However, this package provides a dedicated, out-of-the-box solution with minimal setup, while alternatives require custom code.