imemento / exceptions-laravel
Laravel 的 HTTP 异常处理器
8.1.1
2021-07-28 14:20 UTC
Requires
- php: ^8.0
- laravel/framework: ^8.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-08-28 20:34:58 UTC
README
这是一个自定义异常处理器,需要注册到 Laravel 中。
安装
composer require imemento/exceptions-laravel
将服务添加到 config/app.php 配置文件中
iMemento\Exceptions\Laravel\ExceptionsServiceProvider::class,
异常与格式化器的映射在 config/exceptions.php 文件中完成。
如果需要添加自定义映射,请发布它
php artisan vendor:publish --tag=config
替换 bootstrap/app.php 中的异常处理器
$app->singleton( Illuminate\Contracts\Debug\ExceptionHandler::class, iMemento\Exceptions\Laravel\ExceptionHandler::class );