Skip to content

V.1.0.0

Choose a tag to compare

@stackmasteraliza stackmasteraliza released this 29 Dec 16:06
· 36 commits to master since this release

Laravel API Response Builder

A clean, fluent, and consistent API response builder for Laravel 10/11/12.

Features

  • Standardized JSON Responses - Consistent response structure across your entire API
  • Automatic Pagination Metadata - Built-in support for Laravel pagination
  • Exception Handling - Automatic exception-to-response conversion
  • Validation Error Formatting - Clean formatting for validation errors
  • Controller Trait - Convenient trait for quick integration

Requirements

  • PHP 8.1+
  • Laravel 10.x or 11.x

Installation

composer require stackmasteraliza/laravel-api-response

Quick Start

use Stackmasteraliza\ApiResponse\Facades\ApiResponse;

// Success response
return ApiResponse::success($data, 'Operation successful');

// Error response
return ApiResponse::error('Something went wrong', 400);

License
MIT