Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Validator Laravel Package

aaronadal/validator

Lightweight PHP/Laravel validation package providing a simple API to validate data against rules, collect errors, and customize messages. Useful for quick input checking in apps, forms, and APIs without heavy setup.

View on GitHub
Deep Wiki
Context7

An easy and powerful PHP validation library

Frequently asked questions about Validator
Does **aaronadal/validator** work with Laravel 10 or 11?
The package was last updated in 2020 and hasn’t been tested with Laravel 10/11. You’ll need to manually verify compatibility, especially with newer features like Enums or Attributes. Start with a Laravel 10.x test environment before full integration.
How do I install and set up **aaronadal/validator** in a Laravel project?
Run `composer require aaronadal/validator`, then define rule sets in a dedicated class (e.g., `app/Validators/UserValidator`). Use the validator’s `validate()` method in controllers or services, passing your data and rule set. Follow the README’s basic example for syntax.
Can I reuse validation logic across controllers, jobs, and services?
Yes, the package’s core design focuses on reusable rule sets. Define validation logic once in a class, then call it from anywhere—controllers, jobs, or even API resources—without duplicating code. This aligns with Laravel’s DRY principles.
How does error handling compare to Laravel’s built-in Validator?
The package provides customizable error formatting but may not match Laravel’s native JSON/API responses exactly. You can extend its error collector to align with your project’s needs. For APIs, test responses against Laravel’s default format to identify gaps.
Is **aaronadal/validator** compatible with Laravel Form Requests?
While it doesn’t integrate directly with Form Requests, you can use it alongside them. For example, call the validator inside a Form Request’s `rules()` method or use it in custom validation logic. It’s best suited for internal reuse, not replacing Form Requests entirely.
What’s the performance overhead of using this package vs. Laravel’s native Validator?
The package is lightweight, but since it’s unmaintained, there are no official benchmarks. For most use cases, the overhead should be minimal. Test with your typical payload sizes in a staging environment to compare execution time with Laravel’s built-in Validator.
Does it support nested arrays or conditional validation like Laravel’s native Validator?
The package likely supports basic nested arrays, but conditional validation (e.g., `required_if`) may not be as robust as Laravel’s native solution. Check the README or source code for specific rule examples. For complex logic, you might need to extend the package.
What’s the migration path if this package stops working with newer Laravel versions?
If compatibility breaks, refactor reusable validation logic into Laravel’s native Validator or Form Requests. The package’s design encourages centralization, so migrating should be straightforward—just replace the validator calls with Laravel’s built-in methods or Spatie’s alternatives.
Are there any known issues with testing or mocking this validator?
There’s no built-in testing support, so you’ll need to manually mock validator instances in PHPUnit or Pest. Test validation logic by injecting the validator class and asserting results against mock data. For complex scenarios, consider wrapping the validator in a service layer.
How does this package compare to alternatives like Spatie’s Laravel Validation?
Spatie’s package is actively maintained and integrates deeper with Laravel’s ecosystem, including Form Requests and testing tools. **aaronadal/validator** is simpler but lacks long-term support. Use Spatie’s if you need modern features; this package is better for lightweight, internal reuse in stable environments.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor