askync/utils

Utilities for laravel/lumen framework

Maintainers

Details

github.com/Askync/Utils

Source

Issues

Installs: 108

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/askync/utils

1.11.1 2022-08-01 05:13 UTC

README

#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);
    ...