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

ActiveLibrary[API Development](/categories/api)

snype/api-response
==================

A lightweight Laravel package for consistent and elegant JSON API responses. Simplify your controllers with ApiResponse::success() and ApiResponse::error() methods for structured and reusable response formats.

v2.0.0(1y ago)03MITPHPPHP ^7.0 || ^8.0

Since Jan 28Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (4)Used By (0)

\*\*# Snype API Response

A lightweight Laravel package for consistent and elegant JSON API responses. Simplify your controllers with `ApiResponse::success()` and `ApiResponse::error()` methods for structured and reusable response formats.

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

[](#installation)

You can install the package via Composer:

```
composer require snype/api-response
```

Usage
-----

[](#usage)

### Success Response

[](#success-response)

Use the ApiResponse::success() method to return a successful response.

```
use Snype\ApiResponse\ApiResponse;

public function index()
{
    $data = ['message' => 'Data retrieved successfully'];

    return ApiResponse::success($data, 'Success', 200);
}
```

This will return a structured JSON response with a success status.

### Error Response

[](#error-response)

Use the ApiResponse::error() method to return an error response.

```
use Snype\ApiResponse\ApiResponse;

public function store(Request $request)
{
    // Assuming validation fails
    $errors = ['field' => 'This field is required'];

    return ApiResponse::error($errors, 'Validation Error', 422);
}
```

This will return a structured JSON response with an error status.

### Customization

[](#customization)

You can easily customize the success and error response structure by extending the ApiResponse class.

### Requirements

[](#requirements)

- PHP 8.0 or higher
- Laravel 9.x or 10.x

### License

[](#license)

This package is licensed under the MIT License. \*\*

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance42

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

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

Total

3

Last Release

475d ago

Major Versions

v1.5.0 → v2.0.02025-01-28

PHP version history (3 changes)v1.0.0PHP ^7.4 || ^8.0

v1.5.0PHP ^7.0

v2.0.0PHP ^7.0 || ^8.0

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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