PHPackages                             awaiskhan18/resman - 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. awaiskhan18/resman

ActiveLibrary[API Development](/categories/api)

awaiskhan18/resman
==================

ResMan is a PHP class that provides a convenient way to handle API responses with standard status codes and response structures. It includes methods for handling validation errors, success responses, and failure responses.

v1.0(2y ago)06MITPHP

Since Jul 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/awaiskhan18/laravel-api-reponse-handler)[ Packagist](https://packagist.org/packages/awaiskhan18/resman)[ Docs](https://github.com/awaiskhan18)[ RSS](/packages/awaiskhan18-resman/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

ResMan - Response Manager for API
=================================

[](#resman---response-manager-for-api)

ResMan is a PHP class that provides a convenient way to handle API responses with standard status codes and response structures. It includes methods for handling validation errors, success responses, and failure responses.

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

[](#installation)

To use ResMan in your project, you can install it via Composer. Run the following command in your terminal:

`composer require awaiskhan18/resman`

Usage
-----

[](#usage)

First, import the ResMan class into your PHP file:

```

use Awaiskhan18\ResMan;

```

Handling Validation Errors
--------------------------

[](#handling-validation-errors)

To handle validation errors, you can use the validationHandler method of the ResMan class. It takes a validator object as its parameter and returns a JSON response with the appropriate status code and error messages.

```

// Example usage of validationHandler
$validator = Validator::make($data, $rules);

if ($validator->fails()) {
    return ResMan::validationHandler($validator);
}

```

Handling Success Responses
--------------------------

[](#handling-success-responses)

To handle success responses, you can use the successHandler method of the ResMan class. It takes the response data and a status description as its parameters and returns a JSON response with the success status code (200) and the provided data.

```

// Example usage of successHandler
$data = [
    'user' => [
        'name' => 'John Doe',
        'email' => 'john@example.com',
    ],
];

$statusDescription = 'Data retrieved successfully';

return ResMan::successHandler($data, $statusDescription);

```

Constants

ResMan includes the following constants that can be used to represent different HTTP status codes:

```
ResMan::STATUS_SUCCESS (200) - Represents a successful response.
ResMan::STATUS_ERROR (401) - Represents an error response.

```

License
-------

[](#license)

This package is open-source software licensed under the MIT License. See the LICENSE file for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Unknown

Total

1

Last Release

1025d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78fdf8c41ed0ef7d1624df5dad9097f563623f591f4502706e423151041ef5f2?d=identicon)[awaiskhan18](/maintainers/awaiskhan18)

---

Top Contributors

[![awaiskhan18](https://avatars.githubusercontent.com/u/25448869?v=4)](https://github.com/awaiskhan18 "awaiskhan18 (1 commits)")

---

Tags

responseapilaravel

### Embed Badge

![Health badge](/badges/awaiskhan18-resman/health.svg)

```
[![Health](https://phpackages.com/badges/awaiskhan18-resman/health.svg)](https://phpackages.com/packages/awaiskhan18-resman)
```

###  Alternatives

[vinelab/api-manager

Laravel API Manager Package - beatify and unify your responses with the least effort possible.

392.1k](/packages/vinelab-api-manager)[nilportugues/laravel5-json-api-dingo

Laravel5 JSONAPI and Dingo together to build APIs fast

311.5k](/packages/nilportugues-laravel5-json-api-dingo)[nicklaw5/larapi

A simple Laravel 5 class for handling json api responses.

111.5k](/packages/nicklaw5-larapi)

PHPackages © 2026

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