PHPackages                             larammerce/validation - 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. larammerce/validation

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

larammerce/validation
=====================

A request validation package based on laravel validation and larammerce annotation parser.

1.0.3(6y ago)03MITPHPPHP ^7.1.3

Since Jul 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/larammerce/validation)[ Packagist](https://packagist.org/packages/larammerce/validation)[ RSS](/packages/larammerce-validation/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

Larammerce Validation
=====================

[](#larammerce-validation)

[![Build Status](https://camo.githubusercontent.com/25d5da5c15fc7c1bf913589f435973b0adfec3666eea4d641f84d9a2f647a4b5/68747470733a2f2f7472617669732d63692e6f72672f6c6172616d6d657263652f616e6e6f746174696f6e2d7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/larammerce/validation)

A modern validation package for laravel apps, based on laravel validation and `larammerce/annotation-parser` package.

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

[](#installation)

```
composer require larammerce/validation
```

Usage
-----

[](#usage)

- First you need to publish configuration file for this project.

```
php artisan vendor:publish --provider="Larammerce\Validation\ValidationServiceProvider"
```

- Then customise the config file if needed.

```
return [
    "annotation_name" => "my_rules", // the rules will be read from @my_rules annotation.
    "dynamic_rules_key" => "dynamic_rules" // dynamic rules (described in docs) will be read from dynamic_rules key.
];
```

- Add `Larammerce\Validation\Middleware\RulesMiddleware::class` to your route or group of routes as middleware directly, or you can add it to `$routeMiddleware` in `/app/Http/Kernel.php` file.

```
//Kernel.php file.
protected $routeMiddleware = [
    //...
    "rules" => Larammerce\Validation\Middleware\RulesMiddleware::class
];
```

```
//routes/web.php | routes/api.php file.
Route::get("/test-route", "App\Http\Controllers\HomeController@main")->middleware("rules");
```

```
//app/Http/Controllers/HomeController.php
class HomeController extends Controller {
    /**
     * @my_rules(title="required", dynamic_rules=App\Http\Controllers\HomeController::dynamicRules(request("title")))
     */
    public function main(Request $request){
        return "Hello";
    }

    public static function dynamicRules($title){
        //conditional rules according to passed data.
        return [
            $title."_input" => "required"
        ];
    }
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

2498d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a527a06dcbac102eacd39bd8f8a5dfd3f82b5be0c55f7d471989a1e92cd9455?d=identicon)[a-khajelou](/maintainers/a-khajelou)

---

Top Contributors

[![arash-khajelou](https://avatars.githubusercontent.com/u/3676743?v=4)](https://github.com/arash-khajelou "arash-khajelou (12 commits)")

---

Tags

validationlibrarylarammerce

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/larammerce-validation/health.svg)

```
[![Health](https://phpackages.com/badges/larammerce-validation/health.svg)](https://phpackages.com/packages/larammerce-validation)
```

###  Alternatives

[inhere/php-validate

generic data validate, filter library of the php

26787.4k13](/packages/inhere-php-validate)[carsdotcom/laravel-json-schema

Json Schema validation for Laravel projects

1036.7k3](/packages/carsdotcom-laravel-json-schema)[lionix/envclient

Laravel environment client and console commands.

1621.5k](/packages/lionix-envclient)[eftec/validationone

It's a php library for fetch and validate fields

113.8k4](/packages/eftec-validationone)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
