A Simple Laravel package built to generate API Respond.
To get started, Install via composer:
composer require yasinkose/api-responder
Append the following line to the providers
key in config/app.php
to register the package:
YasinKose\ApiResponder\ServiceProvider::class,
or if you're using Lumen, Add the following snippet to the bootstrap/app.php
file under the providers section
as follows:
$app->register(YasinKose\ApiResponder\ServiceProvider::class);
If you're using Laravel, Add ApiResponder
Facades
to the aliases
key:
'Respond' => YasinKose\ApiResponder\Facades\ApiResponder::class,
or if you're using Lumen Add the following snippet to the bootstrap/app.php
class_alias(YasinKose\ApiResponder\Facades\ApiResponder::class, "Respond");
Respond::ok(string $message = "OK", $attr = [])
Respond::unAuthenticated(string $message = "Unauthorized", $errors = [])
Respond::forbidden(string $message = "Forbidden", $errors = [])
Respond::error(string $message = null, $errors = [])
Respond::created($attr = null)
Respond::failedValidation(string $message = "Unprocessable Entity", $errors = [])
Respond::noContent(string $message = "No Content", $errors = [])
If you discover any security related issues, please email instead of using the issue tracker.
Thanks goes to these people: