| Package Data | |
|---|---|
| Maintainer Username: | solo |
| Maintainer Contact: | ssoloim@gmail.com (solo) |
| Package Create Date: | 2016-10-08 |
| Package Last Update: | 2017-06-18 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-15 03:01:36 |
| Package Statistics | |
|---|---|
| Total Downloads: | 92 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 8 |
| Total Watchers: | 1 |
| Total Forks: | 0 |
| Total Open Issues: | 0 |
Install using composer:
composer require soloslee/json-response
Add the service provider in config/app.php:
'Soloslee\JsonResponse\JsonResponseServiceProvider::class',
And add the JsonResponse alias to config/app.php:
'JsonResponse' => Soloslee\JsonResponse\Facades\JsonResponse::class,
Start by creating an JsonResponse instance (or use the JsonResponse Facade if you are using Laravel):
use Soloslee\JsonResponse\JsonResponse;
return JsonResponse::success();
JsonResponse::success([
'id' => $user->id,
'phone' => $user->phone,
'email' => $user->email,
'authorized' => $user->cleaner,
'token' => $user->token
]);
JsonResponse::error('Fails to send message.', 602);
Laravel Json Response is licensed under MIT license.