From e0aef7537bad8096858cfac5873ca245860b80aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 20 Apr 2022 17:43:26 +0200 Subject: [PATCH] Install handler + require kwaadpepper/exception-handler --- .env.example | 3 ++ README.md | 1 + app/Exceptions/Handler.php | 2 +- composer.json | 1 + composer.lock | 63 +++++++++++++++++++++++++++++++++++- config/exception-handler.php | 17 ++++++++++ 6 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 config/exception-handler.php diff --git a/.env.example b/.env.example index f840b56..ae05c88 100644 --- a/.env.example +++ b/.env.example @@ -58,3 +58,6 @@ ELASTICSEARCH_HOSTS= MAIL_LIST_SERVICEWEB= PROJECT_UUID= + +## MAIL ADDRESSES +MAIL_LIST_SERVICEWEB=equipe.web@ldc.fr diff --git a/README.md b/README.md index fb924f4..90a0c2e 100644 --- a/README.md +++ b/README.md @@ -29,3 +29,4 @@ php artisan key:generate .env => remplacer MAIL_DRIVER par MAIL_MAILER .env => remplacer FILESYSTEM_DRIVER par FILESYSTEM_DISK .env rajouter PROJECT_UUID= +.env rajouter MAIL_LIST_SERVICEWEB=equipe.web@ldc.fr diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index a6201b6..7f151fa 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -2,7 +2,7 @@ namespace App\Exceptions; -use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; +use Kwaadpepper\ExceptionHandler\Exceptions\ExceptionHandler; use Throwable; class Handler extends ExceptionHandler diff --git a/composer.json b/composer.json index 6b88dc5..f2ae2b6 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,7 @@ "elasticquent/elasticquent": "dev-master", "guzzlehttp/guzzle": "^7.2", "james-heinrich/getid3": "^1.9", + "kwaadpepper/exception-handler": "^0.0.8", "laravel/framework": "^9.2", "laravel/sanctum": "^2.14.1", "laravel/tinker": "^2.7", diff --git a/composer.lock b/composer.lock index 38055cb..4c191d9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e690757a597d0cca2b46c8f6687363cf", + "content-hash": "457dd2e3448d3646b80e7729936da21e", "packages": [ { "name": "adldap2/adldap2", @@ -1319,6 +1319,67 @@ }, "time": "2021-09-22T16:34:51+00:00" }, + { + "name": "kwaadpepper/exception-handler", + "version": "0.0.8", + "source": { + "type": "git", + "url": "https://github.com/Kwaadpepper/exception-handler.git", + "reference": "e8ba0e31ca2bf5971e459c623f0f5322a4c7a630" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Kwaadpepper/exception-handler/zipball/e8ba0e31ca2bf5971e459c623f0f5322a4c7a630", + "reference": "e8ba0e31ca2bf5971e459c623f0f5322a4c7a630", + "shasum": "" + }, + "require": { + "illuminate/support": "~7|~8|~9", + "laravel/framework": "~7|~8|~9" + }, + "require-dev": { + "orchestra/testbench": "^6.13", + "phpunit/phpunit": "~9.0", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Kwaadpepper\\ExceptionHandler\\ExceptionHandlerServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Kwaadpepper\\ExceptionHandler\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jérémy Munsch", + "email": "github@jeremydev.ovh", + "homepage": "https://jeremydev.ovh" + } + ], + "description": "Send emails when exceptions occurs", + "homepage": "https://github.com/kwaadpepper/exception-handler", + "keywords": [ + "email", + "exception", + "laravel", + "policies" + ], + "support": { + "issues": "https://github.com/Kwaadpepper/exception-handler/issues", + "source": "https://github.com/Kwaadpepper/exception-handler/tree/0.0.8" + }, + "time": "2022-02-03T15:23:22+00:00" + }, { "name": "laravel/framework", "version": "v9.9.0", diff --git a/config/exception-handler.php b/config/exception-handler.php new file mode 100644 index 0000000..e6bd69b --- /dev/null +++ b/config/exception-handler.php @@ -0,0 +1,17 @@ + !config('app.debug'), + + /** + * Put a developper secured mailbox in here + * so you can receive email if things go mad + */ + 'contactsList' => [ + env('MAIL_LIST_SERVICEWEB', 'equipe.web@ldc.fr') + ] +];