PHPackages                             johnvict/error-format - 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. johnvict/error-format

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

johnvict/error-format
=====================

Error-Format helps you do validation and returns a more pleasing error object if there is one or more, using Laravel In-built Validator

v0.0.3(5y ago)044MITPHPPHP ^7.2

Since Oct 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Johnvict/error-format)[ Packagist](https://packagist.org/packages/johnvict/error-format)[ RSS](/packages/johnvict-error-format/feed)WikiDiscussions master Synced 5d ago

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

ERROR FORMAT
============

[](#error-format)

Error Format is used to format error on laravel/lumen framework. It restructures the error object to a simpler-to-use error object

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

[](#installation)

Use composer to install Error Format.

```
composer require johnvict/error-format
```

Usage
-----

[](#usage)

```
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Johnvict\ErrorFormat\Services\ErrorFormat;

class ExampleController extends Controller
{
	/**
	 * Add the ErrorFormat trait to your controller to enable the use of validate request as part of the controller class
	 */
	use ErrorFormat;

    public function home(Request $request) {
		// You can define an array of your validation rule
		$errorRule = [
			"name" => "required|string",
			"phone" => "required|string",
			"username" => "required|string",
			"email" => "email"
		];
		// call the validateRequest as follows
		$error = self::validateRequest($request, $errorRule);
		return response()->json($error);
	}
}
```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License
-------

[](#license)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

3

Last Release

2039d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/35051689?v=4)[Oluwadamilola Johnvict Olamibo](/maintainers/Johnvict)[@Johnvict](https://github.com/Johnvict)

---

Top Contributors

[![Johnvict](https://avatars.githubusercontent.com/u/35051689?v=4)](https://github.com/Johnvict "Johnvict (11 commits)")

### Embed Badge

![Health badge](/badges/johnvict-error-format/health.svg)

```
[![Health](https://phpackages.com/badges/johnvict-error-format/health.svg)](https://phpackages.com/packages/johnvict-error-format)
```

###  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)
