PHPackages                             wessama/laravel-pretty-validation-messages - 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. wessama/laravel-pretty-validation-messages

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

wessama/laravel-pretty-validation-messages
==========================================

Simple trait to dynamically set up validation messages for Laravel form requests

v1.0.1(2y ago)03MITPHPPHP ^7.3|^8.0

Since Oct 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/wessama/laravel-pretty-validation-messages)[ Packagist](https://packagist.org/packages/wessama/laravel-pretty-validation-messages)[ RSS](/packages/wessama-laravel-pretty-validation-messages/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Laravel Pretty Validation Messages
==================================

[](#laravel-pretty-validation-messages)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0c0310fd968710489d625151d242bffbb5dfefb65533ed4bfd805afa40ce1e42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77657373616d612f6c61726176656c2d7072657474792d76616c69646174696f6e2d6d657373616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wessama/laravel-pretty-validation-messages)[![Total Downloads](https://camo.githubusercontent.com/5521a8dabfa69dc36389fcd5d05708b7d2020c5d92ddd3cf155538a32464fd0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77657373616d612f6c61726176656c2d7072657474792d76616c69646174696f6e2d6d657373616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wessama/laravel-pretty-validation-messages)

Laravel Pretty Validation Messages is a Laravel package providing a trait for FormRequests to use translation strings for validation messages.

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

[](#installation)

You can install the package via composer:

```
composer require wessama/laravel-pretty-validation-messages

```

Or you can just add it to your `composer.json` file:

```
{
    "require": {
        "wessama/laravel-pretty-validation-messages": "^1.0"
    }
}

```

Otherwise, you can clone the repo and include the trait in your FormRequests manually.

Usage
-----

[](#usage)

After installation, use the `HasPrettyValidationMessages` trait in your FormRequest classes:

```
// app/Http/Requests/YourFormRequest.php

use WessamA\LaravelPrettyValidationMessages\HasPrettyValidationMessages;

class YourFormRequest extends FormRequest
{
    use HasPrettyValidationMessages;

    // Your rules and other FormRequest logic here...
}

```

Set up your localization strings with keys that match the expected pattern.

The whole point is to not have to write `message()` methods over and over again for every `FormRequest` you have in your project. Instead, you can plug this trait into any `FormRequest` and have it automatically use the translation strings you've already defined.

The trait will look for a translation string with the following pattern:

```
validation.{fqcn}.{field}.{rule}

```

Where `{fqcn}` is the fully qualified class name of the `FormRequest`, `{field}` is the name of the `FormRequest` being validated, and `{rule}` is the name of the validation rule.

For instance, take the following `FormRequest`:

```
class StoreUserDetailsRequest extends FormRequest
{
    // ...
}

```

Your translation strings would look like this:

```
// /lang/en/validation.php

return [
        \App\Http\Requests\Form\StoreUserDetails::class => [
            'email' => [
                'required' => 'Email address is required',
                'email'   => 'Email address looks weird, innit?',
                // add more rules here...
            ],
            'password' => [
                'required' => 'Password is required',
                // add more rules here...
            ],
        ],
];

```

Testing
-------

[](#testing)

You can run the tests with:

```
    composer test

```

Credits
-------

[](#credits)

- Wessam Ahmed

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Unknown

Total

1

Last Release

947d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/395d9c956658287ad592092118bbbd16642bf3fb480b2d2cd703b3a2fae567eb?d=identicon)[wessama](/maintainers/wessama)

---

Top Contributors

[![wessama](https://avatars.githubusercontent.com/u/22729698?v=4)](https://github.com/wessama "wessama (5 commits)")

---

Tags

laravellocalizationphpvalidation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wessama-laravel-pretty-validation-messages/health.svg)

```
[![Health](https://phpackages.com/badges/wessama-laravel-pretty-validation-messages/health.svg)](https://phpackages.com/packages/wessama-laravel-pretty-validation-messages)
```

###  Alternatives

[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

3651.8M3](/packages/sunspikes-clamav-validator)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)

PHPackages © 2026

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