Search by

bhry98 / laravel-api-response

bhry98

A fluent, extensible, and highly configurable API response toolkit for Laravel 11, 12, 13 and 14.

v2.0.0 2026-07-28 09:25 UTC

This package is auto-updated.

Last update: 2026-11-15 10:28:42 UTC


README

Laravel API Response: one fluent builder for every JSON response your API sends

Latest Version on Packagist Tests Total Downloads License

Laravel API Response

A fluent, extensible API response toolkit for Laravel 11, 12, 13 and 14. Every response your API sends (success, error, validation, pagination, resources) comes out in the same configurable JSON envelope. It works with zero configuration, and you can customize it as far as you need.

composer require bhry98/laravel-api-response
return api()->created($user);

return api()
    ->success()
    ->message('User created.')
    ->data($user)
    ->meta(['version' => 'v1'])
    ->send();
{
    "status": true,
    "message": "User created.",
    "data": { "id": 1, "name": "Jane" },
    "meta": { "version": "v1" }
}

Highlights: ready-made HTTP and business shortcuts, automatic handling of models/resources/paginators, renameable keys and swappable presets (default, minimal, mobile, jsonapi), opt-in exception rendering, rate limiting, audit logging and locale resolution, plus hooks, events, macros and testing assertions.

📖 Documentation

Read the full documentation at bhry98.github.io/packages/laravel-api-response. It covers installation, every response helper, configuration, and every extension point.

For more packages, visit bhry98.github.io/packages.

License

MIT. See LICENSE.