PHPackages                             sobhan-aali/laravel-apiresponse - 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. sobhan-aali/laravel-apiresponse

ActiveLibrary[API Development](/categories/api)

sobhan-aali/laravel-apiresponse
===============================

A Laravel package to standardize JSON API responses and centralize exception handling

v1.0.1(8mo ago)114MITPHP

Since Jun 17Pushed 8mo agoCompare

[ Source](https://github.com/LotousOrganization/laravel-apiresponse)[ Packagist](https://packagist.org/packages/sobhan-aali/laravel-apiresponse)[ RSS](/packages/sobhan-aali-laravel-apiresponse/feed)WikiDiscussions master Synced 1mo ago

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

Standardizing API Responses and Handling All Exceptions
=======================================================

[](#standardizing-api-responses-and-handling-all-exceptions)

👋 Introduction
--------------

[](#-introduction)

Hi, I'm **Sobhan Aali** — thank you for choosing this package!

This package helps you standardize all your API JSON responses and handle exceptions gracefully across your Laravel project, including:

- ✅ Consistent and customizable **API Response formatting**
- ✅ Centralized **Exception handling** with meaningful JSON outputs
- ✅ Easy-to-use **Traits** and response classes to speed up development

---

Installation:
-------------

[](#installation)

```
composer require sobhan-aali/laravel-apiresponse
```

What’s Next?
------------

[](#whats-next)

Two files will be automatically created for you to customize:

- `Responses/ApiResponse.php`
- `Traits/Exceptions.php`

---

How to Enable Exception Handling
--------------------------------

[](#how-to-enable-exception-handling)

Add the following code to your `bootstrap/app.php` file to automatically handle exceptions using the package’s trait:

```
use App\Helpers\Exceptions;

$app->withExceptions(function ($exceptions) {

    $exceptions->renderable(function (Throwable $exception, $request) use ($handler) {
        return Exceptions::render($exception, $request);
    });
});
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance58

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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 ~61 days

Total

2

Last Release

269d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce98e46be51127a678d0212cc2569a334fc2fbbb98416b7780bb32d70d1b85a8?d=identicon)[Sobhanaali](/maintainers/Sobhanaali)

---

Top Contributors

[![Sobhanaali](https://avatars.githubusercontent.com/u/95542970?v=4)](https://github.com/Sobhanaali "Sobhanaali (14 commits)")

### Embed Badge

![Health badge](/badges/sobhan-aali-laravel-apiresponse/health.svg)

```
[![Health](https://phpackages.com/badges/sobhan-aali-laravel-apiresponse/health.svg)](https://phpackages.com/packages/sobhan-aali-laravel-apiresponse)
```

###  Alternatives

[mollie/laravel-mollie

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

3624.1M28](/packages/mollie-laravel-mollie)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[spatie/laravel-route-discovery

Auto register routes using PHP attributes

23645.0k2](/packages/spatie-laravel-route-discovery)[esign/laravel-conversions-api

A laravel wrapper package around the Facebook Conversions API

69145.4k](/packages/esign-laravel-conversions-api)[didww/didww-api-3-php-sdk

PHP SDK for DIDWW API 3

1218.2k](/packages/didww-didww-api-3-php-sdk)[surface/laravel-webfinger

A Laravel package to create an ActivityPub webfinger.

113.8k](/packages/surface-laravel-webfinger)

PHPackages © 2026

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