Package Data | |
---|---|
Maintainer Username: | godamri |
Maintainer Contact: | askyncc@gmail.com (Askync) |
Package Create Date: | 2020-07-20 |
Package Last Update: | 2022-08-01 |
Language: | PHP |
License: | mit |
Last Refreshed: | 2025-04-16 03:07:15 |
Package Statistics | |
---|---|
Total Downloads: | 105 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
#Askync/Utils
###Some Api Utilities for laravel/lumen framework
Success Response
return \Askync\Utils\Facades\AskyncResponse::success([
'name' => 'John Doe',
'email' => 'doe@john.com'
]);
Error Response
return \Askync\Utils\Facades\AskyncResponse::success(401, 'Unauthorized');
Throw Error as Response, Break the process and return response from anywhere in your code
throw new \Askync\Utils\Utils\ResponseException('Server cannot accept the data type');
##Setup
bootstrap/app.php
...
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
\Askync\Utils\Handler\LumenErrorHandler::class
);
...
$app->register(\Askync\Utils\UtilsServiceProvider::class);
...