laravel-api-response maintained by eliseekn
Description
Send JSON response from your API.
Author
Last update
2024/03/05 06:39
(dev-main)
License
Downloads
115
Tags
Laravel API Response
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(...);