eliseekn/laravel-api-response

Send JSON response from your API.

Installs: 115

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/eliseekn/laravel-api-response

v0.0.4 2024-03-05 05:39 UTC

This package is auto-updated.

Last update: 2025-10-05 09:07:01 UTC


README

Latest Version on Packagist Total Downloads

Send JSON response from your API.

Installation

composer require eliseekn/laravel-api-response

Usage

Add MakeApiResponse trait where you need to use and use it as follows :

$this->response('success', 'Lorem ipsum dolor sit amet', 201);
$this->response('warning', [
    'key1' => 'value',
    'key2' => 'value'
], 405);

$this->successResponse('Lorem ipsum dolor sit amet');
$this->successResponse([
    'key1' => 'value',
    'key2' => 'value'
]);

$this->errorResponse(...);