PHPackages                             red-explosion/undefined - 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. [API Development](/categories/api)
4. /
5. red-explosion/undefined

ActiveLibrary[API Development](/categories/api)

red-explosion/undefined
=======================

API error handling for Laravel.

v0.2.0(2y ago)1200[1 PRs](https://github.com/red-explosion/undefined/pulls)MITPHPPHP ^8.2

Since May 23Pushed 2y ago2 watchersCompare

[ Source](https://github.com/red-explosion/undefined)[ Packagist](https://packagist.org/packages/red-explosion/undefined)[ Docs](https://github.com/red-explosion/undefined)[ RSS](/packages/red-explosion-undefined/feed)WikiDiscussions main Synced 1mo ago

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

Undefined
=========

[](#undefined)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a9a4b63e851ccd259a0ffcda6c133a22b6f78464e583c5728d674eb2fb4730f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7265642d6578706c6f73696f6e2f756e646566696e65642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/red-explosion/undefined)[![GitHub Tests Action Status](https://camo.githubusercontent.com/77ff2db82441ca6fde6ce562ede3d4adeac2c1b354f9824da4b4b1da5b1c3e70/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7265642d6578706c6f73696f6e2f756e646566696e65642f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/red-explosion/undefined/actions/workflows/tests.yaml?query=branch:main)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/e311397514245c62dc6985197fd025d8efe5477690b11aea8867449c7504d6a8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7265642d6578706c6f73696f6e2f756e646566696e65642f636f64696e672d7374616e64617264732e796d6c3f6c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/red-explosion/undefined/actions/workflows/coding-standards.yml?query=branch:main)[![Total Downloads](https://camo.githubusercontent.com/14d084214a89afd4c1bc7fd0ad11c3b2f3613cf1de32e9faa61509c24c793947/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7265642d6578706c6f73696f6e2f756e646566696e65642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/red-explosion/undefined)

Undefined for Laravel takes care of formatting exceptions and errors into nicely formatted JSON responses.

> **Warning**Package is in early stages of development. It means there may be bugs and API is very likely to change. Create an issue if you spot a bug. Ideas are welcome.

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

[](#installation)

You can install the package via composer:

```
composer require red-explosion/undefined
```

You can publish the config file with:

```
php artisan vendor:publish --tag="undefined-config"
```

Usage
-----

[](#usage)

In order to use Undefined, you need to replace your exception handler. Replace the following in your `bootstrap/app.php` file:

```
$app->singleton(
    Illuminate\Contracts\Debug\ExceptionHandler::class,
    App\Exceptions\Handler::class
);
```

with the following:

```
$app->singleton(
    Illuminate\Contracts\Debug\ExceptionHandler::class,
    RedExplosion\Undefined\ExceptionHandler::class
);
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability, please send an e-mail to Ben Sherred via . All security vulnerabilities will be promptly addressed.

Credits
-------

[](#credits)

- [Ben Sherred](https://github.com/bensherred)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% 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 ~73 days

Total

2

Last Release

1017d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a81c5266912c039021715b77d96ad65b6aac3a76f39430331f31ea240f0c14e?d=identicon)[bensherred](/maintainers/bensherred)

---

Top Contributors

[![bensherred](https://avatars.githubusercontent.com/u/22666637?v=4)](https://github.com/bensherred "bensherred (26 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

laravelred-explosionundefined

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/red-explosion-undefined/health.svg)

```
[![Health](https://phpackages.com/badges/red-explosion-undefined/health.svg)](https://phpackages.com/packages/red-explosion-undefined)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[api-ecosystem-for-laravel/dingo-api

A RESTful API package for the Laravel and Lumen frameworks.

3121.5M10](/packages/api-ecosystem-for-laravel-dingo-api)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[kirschbaum-development/laravel-openapi-validator

Automatic OpenAPI validation for Laravel HTTP tests

581.1M5](/packages/kirschbaum-development-laravel-openapi-validator)

PHPackages © 2026

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