PHPackages                             weckhawk/pretty-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. weckhawk/pretty-response

ActiveLibrary

weckhawk/pretty-response
========================

A fluent and consistent API response builder for Laravel applications.

1.0.0(today)01↑2900%MITPHPPHP ^8.2

Since Jul 27Pushed todayCompare

[ Source](https://github.com/Weckhawk/PrettyResponse)[ Packagist](https://packagist.org/packages/weckhawk/pretty-response)[ RSS](/packages/weckhawk-pretty-response/feed)WikiDiscussions main Synced today

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

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

[](#laravel-api-response-builder)

A fluent, expressive, and consistent API response wrapper for Laravel applications. It helps you standardize JSON responses, handle paginators automatically, and keep your controllers clean.

Features
--------

[](#features)

- **Standardized Structure**: Ensures every JSON response follows a predictable format (`success`, `message`, `data`, `errors`, `meta`).
- **Smart Pagination Handling**: Automatically extracts metadata from Eloquent `LengthAwarePaginator`, `SimplePaginator`, and `CursorPaginator`.
- **Resource Resolution**: Seamlessly unwraps Laravel's `JsonResource` and `ResourceCollection`.
- **Semantic Named Constructors**: Clean static methods like `ApiResponse::success()`, `ApiResponse::validationError()`, etc.

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

[](#installation)

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

Basic Usage
-----------

[](#basic-usage)

### Success Response

[](#success-response)

```
use Weckhawk\PrettyResponse\ApiResponse;

return ApiResponse::success(\$users, 'Users fetched successfully');
```

### Paginated Response

[](#paginated-response)

Pass any Laravel paginator directly into the `success` method. The package will automatically append the `meta` object:

```
\$paginatedUsers = User::paginate(15);

return ApiResponse::success(\$paginatedUsers);
```

### Error Responses

[](#error-responses)

```
return ApiResponse::notFound('User not found');

return ApiResponse::validationError([
    'email' => ['The email field is required.']
]);
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/88083364?v=4)[Weckhawk](/maintainers/Weckhawk)[@Weckhawk](https://github.com/Weckhawk)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/weckhawk-pretty-response/health.svg)

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

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k30.2M151](/packages/laravel-cashier)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k55.0M633](/packages/laravel-scout)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M348](/packages/psalm-plugin-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M134](/packages/roots-acorn)

PHPackages © 2026

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