PHPackages                             opscale-co/validations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. opscale-co/validations

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

opscale-co/validations
======================

Model validation for Laravel application.

1.0.0(2mo ago)0273↓41.7%4MITShellCI failing

Since Apr 8Pushed 1mo agoCompare

[ Source](https://github.com/opscale-co/validations)[ Packagist](https://packagist.org/packages/opscale-co/validations)[ RSS](/packages/opscale-co-validations/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (4)

Support us
----------

[](#support-us)

At Opscale, we're passionate about contributing to the open-source community by providing solutions that help businesses scale efficiently. If you've found our tools helpful, here are a few ways you can show your support:

⭐ **Star this repository** to help others discover our work and be part of our growing community. Every star makes a difference!

💬 **Share your experience** by leaving a review on [Trustpilot](https://www.trustpilot.com/review/opscale.co) or sharing your thoughts on social media. Your feedback helps us improve and grow!

📧 **Send us feedback** on what we can improve at . We value your input to make our tools even better for everyone.

🙏 **Get involved** by actively contributing to our open-source repositories. Your participation benefits the entire community and helps push the boundaries of what's possible.

💼 **Hire us** if you need custom dashboards, admin panels, internal tools or MVPs tailored to your business. With our expertise, we can help you systematize operations or enhance your existing product. Contact us at  to discuss your project needs.

Thanks for helping Opscale continue to scale! 🚀

Description
-----------

[](#description)

Model validation for Laravel applications. An easy validator option for your Eloquent models with flexibility for additional code that can be executed before and after validation.

The package exposes two public symbols:

SymbolKindPurpose`Opscale\Validations\Validatable`TraitWires validation into Eloquent lifecycle events and runs optional `beforeValidation` / `afterValidation` hooks`Opscale\Validations\ModelValidator`ClassResolves rules / messages / attributes / data from a model and runs Laravel's validatorAll classes ship with `declare(strict_types=1);` and full type hints — your consuming code is expected to do the same.

Installation
------------

[](#installation)

[![Latest Version on Packagist](https://camo.githubusercontent.com/07ef7a5084617c85446023c5c79ff39ec390afba4221d9e61d129c31c8245a12/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f707363616c652d636f2f76616c69646174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/opscale-co/validations)

You can install the package via composer:

```
composer require opscale-co/validations
```

Usage
-----

[](#usage)

Here the User model is mentioned as an example. You can use this in any model you want.

### Basic Setup

[](#basic-setup)

```
