PHPackages                             bestiony/laravel-api-response - 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. bestiony/laravel-api-response

ActiveLibrary[API Development](/categories/api)

bestiony/laravel-api-response
=============================

A wrapper around Laravel response function that returns a consistent API response o failure or success

v1.0.0.x-dev(1y ago)33MITPHPPHP ^8.1

Since Dec 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/bestiony/LaravelApiResponse)[ Packagist](https://packagist.org/packages/bestiony/laravel-api-response)[ RSS](/packages/bestiony-laravel-api-response/feed)WikiDiscussions main Synced 1mo ago

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

Laravel API Response
====================

[](#laravel-api-response)

A wrapper around Laravel response function that returns a consistent API response on failure or success.

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

[](#installation)

```
composer require bestiony/laravel-api-response
```

Usage
-----

[](#usage)

In your controller or in the main Laravel controller, use the trait `HasApiResponse`:

```
namespace App\Http\Controllers;

use Bestiony\LaravelApiResponse\Traits\HasApiResponse;
use Illuminate\Http\Request;

class ExampleController extends Controller
{
    use HasApiResponse;

    public function index(Request $request)
    {
        $data = ['key' => 'value'];
        return $this->success(message:'Data retrieved successfully',data: $data);
    }

    public function errorExample(Request $request)
    {
        return $this->error(message:'An error occurred', code: 500);
    }
}
```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

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

Unknown

Total

1

Last Release

516d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/264d34faba50ce974931ee6656206e7a751e1f79aa5d100e25df95ee6d9aa152?d=identicon)[Bestiony](/maintainers/Bestiony)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/bestiony-laravel-api-response/health.svg)

```
[![Health](https://phpackages.com/badges/bestiony-laravel-api-response/health.svg)](https://phpackages.com/packages/bestiony-laravel-api-response)
```

###  Alternatives

[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[flat3/lodata

OData v4.01 Producer for Laravel

96320.9k](/packages/flat3-lodata)[joggapp/laravel-aws-sns

Laravel package for the SNS events by AWS

3171.8k](/packages/joggapp-laravel-aws-sns)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[spatie/spatie-price-api

The Price API used at promotional sites for our own products

1515.1k1](/packages/spatie-spatie-price-api)

PHPackages © 2026

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