jeybin / apiresponse
Laravel api response helper
Installs: 65
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/jeybin/apiresponse
This package is auto-updated.
Last update: 2025-10-11 19:28:30 UTC
README
Installation
You can install the package via composer:
composer require jeybin/apiresponse
To publish providers and to copy the config files run :
php artisan apiresponse:install
Usage
If you want to get the response as array you can use:
\Jeybin\Apiresponse\ThrowResponse::status(200) ->message('User defined message') ->get(['can send array or string or empty'])
or else if you want to throw the response you can use:
\Jeybin\Apiresponse\ThrowResponse::status(200) ->message('User defined message') ->throw(['can send array or string or empty'])
Without message
\Jeybin\Apiresponse\ThrowResponse::status(200) ->throw(['can send array or string or empty'])
\Jeybin\Apiresponse\ThrowResponse::status('success')->throw()
Some of the status codes are already defined in the config/jeybin-apiresponse.php file, if you want to add more update that file