Weave 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

Laravel Model Validation Laravel Package

theriddleofenigma/laravel-model-validation

Declare validation rules directly on your Eloquent models and have them run automatically on the events you choose, such as saving, creating, or updating. Invalid saves throw Laravel's ValidationException, so no form requests or repeated validator calls are needed.

View on GitHub
Deep Wiki
Context7
v2.0.0

Major modernization release.

Highlights

  • Laravel 12 & 13 support (dropping end-of-life Laravel 11 and earlier).
  • PHP 8.2+ with a strict-typed, rewritten codebase.
  • Skip validation on demand — skipValidation(), saveWithoutValidation(), and withoutValidation() (resolves #12).
  • A PHPUnit + Orchestra Testbench suite (20 tests) and a CI matrix across PHP 8.2–8.4 × Laravel 12–13, plus Laravel Pint code-style checks.

Added

  • Support for Laravel 13.
  • Ability to skip validation (resolves #12):
    • $model->skipValidation() — fluent per-instance toggle (skipValidation(false) re-enables).
    • $model->saveWithoutValidation() — skips a single save, restoring the instance's prior state.
    • Model::withoutValidation(fn () => ...) — disables validation for the duration of a callback; re-enabled even if it throws.
  • validateOnUpdating() helper for the updating model event.
  • modelValidator() accessor and ModelValidator::makeValidator() for building the underlying validator.
  • Community health files, Pint code-style tooling with a CI check, and a GitHub Actions test matrix.

Changed (breaking)

  • Minimum requirements are now PHP 8.2 and Laravel 12.
  • Depends on the individual illuminate/* components instead of the full laravel/framework.
  • ModelValidator and ValidatorTrait rewritten with strict types and typed signatures; validate() now returns the validated data (array).

Removed

  • Support for Laravel 11 and earlier (end-of-life).

Upgrade guide

  • Ensure your app runs PHP ≥ 8.2 and Laravel ≥ 12.
  • No changes are needed to your models' public API — the trait name, validate(), validateOnSaving()/validateOnCreating(), the validationRules/validationMessages/validationAttributes config, and the validationData/beforeValidation/afterValidation hooks all behave as before.
  • If you relied on the return value of validate(), note it now returns the validated data array.

Full Changelog: https://github.com/theriddleofenigma/laravel-model-validation/compare/v1.6.0...v2.0.0

v1.4.0

What's New

  • Now you can customize the validation data from your model using validationData(...) method.
  • Added support for Laravel v10.

Full Changelog: https://github.com/theriddleofenigma/laravel-model-validation/compare/v1.3...v1.4.0

v1.3

Added support for Laravel v9.

Thanks for the PR #8, @syehan

v1.2

Changes in Minimum laravel framework version due to vulnerability.

v1.1

Improvements for declaring the validation rules, attributes, and messages methods as properties in the eloquent model.

v1.0
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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator