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)43MITPHPPHP ^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 today

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

22

—

LowBetter than 21% of packages

Maintenance37

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

568d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/31532099?v=4)[Abderrahman Fodili](/maintainers/Bestiony)[@bestiony](https://github.com/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

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[flat3/lodata

OData v4.01 Producer for Laravel

99351.7k](/packages/flat3-lodata)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.7k1](/packages/jasara-php-amzn-selling-partner-api)

PHPackages © 2026

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