Skip to content

Instantly share code, notes, and snippets.

@csinghdev
Created April 12, 2020 13:21
Show Gist options
  • Save csinghdev/d967c71a1ceb7095cad28cb4edb12a05 to your computer and use it in GitHub Desktop.
Save csinghdev/d967c71a1ceb7095cad28cb4edb12a05 to your computer and use it in GitHub Desktop.
Response builder config file for mapping API code and messages
<?php
use App\ApiCode;
return [
/*
|-----------------------------------------------------------------------------------------------------------
| Code range settings
|-----------------------------------------------------------------------------------------------------------
*/
'min_code' => 100,
'max_code' => 1024,
/*
|-----------------------------------------------------------------------------------------------------------
| Error code to message mapping
|-----------------------------------------------------------------------------------------------------------
|
*/
'map' => [
ApiCode::SOMETHING_WENT_WRONG => 'api.something_went_wrong',
ApiCode::INVALID_CREDENTIALS => 'api.invalid_credentials',
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment