diff --git a/README.md b/README.md index db9c472..28f6b54 100755 --- a/README.md +++ b/README.md @@ -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": "git@git.liateam.net: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,7 +20,7 @@ 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" ``` @@ -71,7 +28,7 @@ $ php artisan vendor:publish --config="Liateam/api-exceptions/src/config/excepti 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) { diff --git a/composer.json b/composer.json index a5076a3..425ec46 100755 --- a/composer.json +++ b/composer.json @@ -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": "git@git.liateam.net: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" ] } } diff --git a/src/Contracts/ApiExceptionAbstract.php b/src/Contracts/ApiExceptionAbstract.php index ce2c411..4dbfcb2 100755 --- a/src/Contracts/ApiExceptionAbstract.php +++ b/src/Contracts/ApiExceptionAbstract.php @@ -1,11 +1,11 @@