-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'rename_namespace' into develop
2.0.11 changelog: - rename namespace and change from liateam to mojtabarks - edit README.md file
- Loading branch information
Showing
23 changed files
with
71 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,58 +2,15 @@ | |
|
||
a lightweight package for create and pass response for use in laravel || lumen | ||
|
||
### Prerequisites | ||
|
||
before start, you should have personal access token and SSH key. | ||
|
||
* [how to create SSH-key](https://docs.gitlab.com/ee/ssh/README.html#generating-a-new-ssh-key-pair) | ||
* [how to create personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token) | ||
|
||
next you should add your personal access token to composer | ||
|
||
``` | ||
$ composer config \ | ||
--auth gitlab-token.gitlab.com "YOUR-TOKEN-HERE" \ | ||
--no-ansi \ | ||
--no-interaction | ||
``` | ||
|
||
If you prefer to do this manually, create ~/.composer/auth.json, with the following content: | ||
``` | ||
{ | ||
"gitlab-token": { | ||
"gitlab.com": "YOUR-TOKEN-HERE" | ||
} | ||
} | ||
``` | ||
|
||
### Installation | ||
|
||
easily copy below code and paste in your `composer.json` | ||
|
||
``` | ||
"repositories": { | ||
"liateam/api-exceptions" : { | ||
"type": "vcs", | ||
"url": "[email protected]:php/packages/api-exceptions.git" | ||
} | ||
}, | ||
``` | ||
|
||
easily copy below code and paste in your `composer.json` -> `require` section | ||
|
||
``` | ||
"liateam/api-exceptions": "^2.0" | ||
``` | ||
|
||
run the command below in your project : | ||
|
||
``` | ||
$ composer update | ||
$ composer require mojtabarks/api-exceptions | ||
``` | ||
|
||
### lumen specific installation | ||
if your project is lumen so you should copy `Liateam/api-exceptions/src/config/exceptions` to your `config` directory ! | ||
if your project is lumen so you should copy `mojtabarks/api-exceptions/src/config/exceptions` to your `config` directory ! | ||
*NOTE* : If you don't have `config` directory so create it ! | ||
|
||
then add below code in your `bootstrap/app.php` : | ||
|
@@ -63,15 +20,15 @@ then add below code in your `bootstrap/app.php` : | |
|
||
### laravel specific installation | ||
``` | ||
$ php artisan vendor:publish --config="Liateam/api-exceptions/src/config/exceptions.php" | ||
$ php artisan vendor:publish --provider="Mojtabarks/ApiExceptions/Providers/ApiExceptionServiceProvider" | ||
``` | ||
|
||
|
||
## Usage | ||
|
||
overwrite `render` method of `App\Exceptions\Handler` like this : | ||
``` | ||
use Liateam\ApiExceptions\Handlers\ApiException; | ||
use Mojtabarks\ApiExceptions\Handlers\ApiException; | ||
public function render($request, Throwable $exception) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "liateam/api-exceptions", | ||
"name": "mojtabarks/api-exceptions", | ||
"description": "Exception list using in api which help you to easy manage your api exceptions", | ||
"type": "library", | ||
"license": "MIT", | ||
|
@@ -10,24 +10,18 @@ | |
} | ||
], | ||
"require": { | ||
"liateam/api-response": "2.*" | ||
}, | ||
"repositories": { | ||
"liateam/api-response" : { | ||
"type": "vcs", | ||
"url": "[email protected]:php/packages/api-response.git" | ||
} | ||
"mojtabarks/api-response": "2.*" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Liateam\\ApiExceptions\\": "src", | ||
"Liateam\\ApiExceptions\\Tests\\" : "tests" | ||
"Mojtabarks\\ApiExceptions\\": "src", | ||
"Mojtabarks\\ApiExceptions\\Tests\\" : "tests" | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Liateam\\ApiExceptions\\Providers\\ApiExceptionServiceProvider" | ||
"Mojtabarks\\ApiExceptions\\Providers\\ApiExceptionServiceProvider" | ||
] | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.