PHPackages                             decodeblock/api-utility - 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. decodeblock/api-utility

ActiveLibrary[API Development](/categories/api)

decodeblock/api-utility
=======================

Helper functions for api development with laravel

v1.0.0(1y ago)02[4 PRs](https://github.com/decodeblock/api-utility/pulls)MITPHPPHP ^8.4||^8.3CI passing

Since Dec 9Pushed 1mo agoCompare

[ Source](https://github.com/decodeblock/api-utility)[ Packagist](https://packagist.org/packages/decodeblock/api-utility)[ Docs](https://github.com/decodeblock/api-utility)[ GitHub Sponsors](https://github.com/Decodeblock)[ RSS](/packages/decodeblock-api-utility/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (8)Used By (0)

API Utility
===========

[](#api-utility)

[![License](https://camo.githubusercontent.com/cedf2534b853888680690abe5e36965721126f58bc00241f168c0cf916293ecc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6465636f6465626c6f636b2f6170692d7574696c6974792e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)[![Latest Version on Packagist](https://camo.githubusercontent.com/f2f2a07d54866e16e0682fd689ff6939ffaf14541b6531bea5c4833301846d18/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465636f6465626c6f636b2f6170692d7574696c6974792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/decodeblock/api-utility)[![Tests Status](https://camo.githubusercontent.com/bb6f87d6ad49feeebd7c367843598b734bf6b3287d83c220c8dc1b5edb1058cf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6465636f6465626c6f636b2f6170692d7574696c6974792f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/decodeblock/api-utility/actions?query=workflow%3Arun-tests+branch%3Amain)[![Code Style Status](https://camo.githubusercontent.com/689af9c4372673e58c57bdc949c9e3faa2c6dc556d273f25ee50420015af9341/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6465636f6465626c6f636b2f6170692d7574696c6974792f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/decodeblock/api-utility/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/5118033d193ff31b1cae90cc49cfeb58d654c3e4af6e9477fd01d4710415e8bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465636f6465626c6f636b2f6170692d7574696c6974792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/decodeblock/api-utility)[![Contributors](https://camo.githubusercontent.com/6aa637af720bf6c1b02a703b916aefbac1dd06ec969478f47edfee89206f666b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6465636f6465626c6f636b2f6170692d7574696c6974792e7376673f7374796c653d666c61742d737175617265)](https://github.com/decodeblock/api-utility/graphs/contributors)[![PHP Version Support](https://camo.githubusercontent.com/71848f2eae1cdbbeddd59b1b23e90802531079e649c8f6c6feacf6e883ec52ad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6465636f6465626c6f636b2f6170692d7574696c6974792e7376673f7374796c653d666c61742d737175617265)](https://www.php.net/)

A Laravel package providing helper functions for streamlined API development. Simplify response handling and enhance the structure of your APIs.

---

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

[](#installation)

Install the package via Composer:

```
composer require decodeblock/api-utility
```

---

Usage
-----

[](#usage)

### Example

[](#example)

Using the `ApiResponder` trait for handling JSON responses:

```
use Illuminate\Http\Response;
use Decodeblock\ApiUtility\Traits\ApiResponder;

class YourController extends Controller
{
    use ApiResponder;

    public function index()
    {
        return $this->successResponse("Hello, API Utility", Response::HTTP_OK, null);
    }
}
```

The `ApiResponder` trait provides methods like:

- `success($message, $code, $data, $metadata = null)`: For successful responses.
- `error($message, $code, $data, $metadata = null)`: For error responses.

---

Testing
-------

[](#testing)

Run tests using:

```
composer test
```

---

Changelog
---------

[](#changelog)

Detailed changes for each release are documented in the [CHANGELOG](CHANGELOG.md).

---

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

[](#contributing)

We welcome contributions! Please see the [CONTRIBUTING](CONTRIBUTING.md) guide for details.

---

Credits
-------

[](#credits)

- **[Gabriel Ibenye](https://github.com/gabbyti)**

---

License
-------

[](#license)

This package is licensed under the [MIT License](LICENSE.md).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance68

Regular maintenance activity

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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

3

Last Release

524d ago

Major Versions

v0.2.0-alpha → v1.0.02024-12-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/4341becacf17391bee4cb4334e44546b3056aec0d4ad36a0e216102618d7d9a8?d=identicon)[gabbyti](/maintainers/gabbyti)

---

Top Contributors

[![gabbyTI](https://avatars.githubusercontent.com/u/34938103?v=4)](https://github.com/gabbyTI "gabbyTI (18 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

laravelDecodeblockapi-utility

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/decodeblock-api-utility/health.svg)

```
[![Health](https://phpackages.com/badges/decodeblock-api-utility/health.svg)](https://phpackages.com/packages/decodeblock-api-utility)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.0k7.8M57](/packages/dedoc-scramble)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)

PHPackages © 2026

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