PHPackages                             saverty/errors\_handling - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. saverty/errors\_handling

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

saverty/errors\_handling
========================

Laravel Errors Handling allow you to manage errors codes. Sometimes HTTP status aren't enought. With this package you can create your own status with a short description to share it with your team.

1.5(7y ago)118[1 issues](https://github.com/saverty/Laravel-Errors-Handling/issues)MITPHP

Since Nov 23Pushed 7y ago1 watchersCompare

[ Source](https://github.com/saverty/Laravel-Errors-Handling)[ Packagist](https://packagist.org/packages/saverty/errors_handling)[ Docs](https://github.com/saverty/errors_handling)[ RSS](/packages/saverty-errors-handling/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (11)Used By (0)

Laravel Errors Handling
=======================

[](#laravel-errors-handling)

Laravel Errors Handling allow you to manage errors codes. Sometimes HTTP status aren't enought. With this package you can create your own status with a short description to share it with your team.

Installation
============

[](#installation)

**Install the package using composer**

```
composer require saverty/errors_handling

```

**Publish the configuration**

```
php artisan vendor:publish --provider="Saverty\ErrorsHandling\ErrorsHandlingServiceProvider" --tag="config"

```

**Go to your app.php and add the provider**

```
"providers"[
	...
    Saverty\ErrorsHandling\ErrorsHandlingServiceProvider::class,
]

```

Add your codes
--------------

[](#add-your-codes)

Go to errors\_handling.php config file and follow the example. Your codes can be grouped by category. Each code needs a code, a name and a description

```
return [
    //Group your codes
    "Authentifcation" => [

        //Detail your code
        "AUTH001" => [
            "name" => "Login Fail",
            "description" => "Email or password is wrong"
        ]
     ]
]

```

**Use the package**

```
use Saverty\ErrorsHandling\ErrorsHandling;

```

**Add a code error**

```
$errors = new ErrorsHandling();

$errors->add("AUTH001");

```

**Add multiple errors**

```
$errors = new ErrorsHandling();
$errors->add('AUTH001')->add('AUTH002');

```

**Group your errors**

```
$errors = new ErrorsHandling();

$errors->add('AUTH001', 'email')->add('AUTH002','email');
$errors->add('AUTH003', 'name')->add('AUTH004','name');

```

**Check if errors are presents**

```
if($errors->hasErrors()){
    //Errors
}else{
    // No errors
}

```

**Return errors as an array**

```
$errors->toArray();

```

**Return errors as a Json**

```
$errors->toJson();

```

**Use the laravel validator**

```
 $validator = Validator::make($request->all(),
        [
            "email" => ['required', 'integer'],
            "password" => ['required', 'email']
        ],
        [
            "email.integer" => "AUTH001"
        ]
 );

 $errors->injectValidator($validator);

```

Your documentation
------------------

[](#your-documentation)

You can see the all your codes at this url : {your\_domain}/errorshandling

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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

2726d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67e651c79bd8a41774573c78312ccbd8428a04effe552b4921e29fab6b7bfaab?d=identicon)[AvertySteve](/maintainers/AvertySteve)

---

Top Contributors

[![saverty](https://avatars.githubusercontent.com/u/13039385?v=4)](https://github.com/saverty "saverty (24 commits)")

---

Tags

laravelhandlingerrorserrors handling

### Embed Badge

![Health badge](/badges/saverty-errors-handling/health.svg)

```
[![Health](https://phpackages.com/badges/saverty-errors-handling/health.svg)](https://phpackages.com/packages/saverty-errors-handling)
```

###  Alternatives

[stephenjude/filament-blog

Filament Blog Builder

20317.8k](/packages/stephenjude-filament-blog)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11229.2k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

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