Download the PHP package nurbekjummayev/laravel-api-response-helpers without Composer
On this page you can find all versions of the php package nurbekjummayev/laravel-api-response-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nurbekjummayev/laravel-api-response-helpers
More information about nurbekjummayev/laravel-api-response-helpers
Files in nurbekjummayev/laravel-api-response-helpers
Package laravel-api-response-helpers
Short Description A Laravel package for standardized API responses
License MIT
Homepage https://github.com/NurbekJummayev/laravel-api-response-helpers
Informations about the package laravel-api-response-helpers
Laravel API Response Helpers
A Laravel package for standardized API responses with helpful exceptions.
Installation
Install the package via composer:
Usage
Helper Functions
The package provides convenient helper functions for common HTTP responses:
Success Responses
Error Responses
Custom Response
Exceptions
The package provides exception classes that automatically render as JSON responses:
Available Exceptions
ApiResponseException- Base exception classBadRequestException- 400UnauthorizedException- 401ForbiddenException- 403NotFoundException- 404MethodNotAllowedException- 405PostTooLargeException- 413ValidationException- 422TooManyRequestsException- 429ServerErrorException- 500
Note:
ValidationExceptionshares its short name with Laravel's ownIlluminate\Validation\ValidationException. If you need both in the same file, import this package's class with an alias:
Response Format
All responses follow a consistent structure:
Standard Response:
Paginated Response:
okWithPaginateResponse() supports all three Laravel paginators:
paginate()— fullmetaas shown above.simplePaginate()—metawithcurrent_page,from,per_page,to,has_more(nototal/last_page).cursorPaginate()—metawithper_page,next_cursor,prev_cursor.
With Extra Data:
AI Support (Laravel Boost)
This package ships first-class AI support for Laravel Boost. When a project that uses Boost installs this package, the guidelines and an agent skill are discovered automatically.
What's included:
- Guideline —
resources/boost/guidelines/core.blade.php: a short, always-loaded overview of the response envelope and helpers. - Skill —
resources/boost/skills/api-response-helper/SKILL.md: the fullapi-response-helperskill, loaded on demand when an agent works on API responses.
In a consuming project that already has Boost installed:
Boost then teaches the coding agent (Claude Code, Cursor, Copilot, etc.) to use okResponse(), okWithPaginateResponse(), the error helpers, and the renderable exceptions correctly. No configuration is required — discovery is based on the resources/boost/ directory.
Testing
Code Quality
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-api-response-helpers with dependencies
illuminate/contracts Version ^10 || ^11 || ^12 || ^13
illuminate/http Version ^10 || ^11 || ^12 || ^13
spatie/laravel-package-tools Version ^1.92.7