cbLink / laravel-exception
包描述在这里。
v0.1.1
2023-02-06 02:09 UTC
Requires
- cblink/laravel-dto: ^0.3.0|^1.0.0|^2.0.0
Requires (Dev)
- orchestra/testbench: ^3.7|^3.8|^4.0|^5.0
This package is auto-updated.
Last update: 2024-09-06 05:31:12 UTC
README
.
安装
$ composer require cblink/laravel-exception -vvv
使用
php artisan vendor:publish --provider="Cblink\LaravelException\ExceptionServiceProvider"
修改 app/Exceptions/Handler.php
<?php namespace App\Exceptions; use Exception; use Cblink\LaravelException\BaseHandler; // extends `Cblink\LaravelException\BaseHandler` class Handler extends BaseHandler { // ... /** * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request * @param Exception $exception * * @return \Illuminate\Http\Response */ public function render($request, Exception $exception) { // parent::render($request, $exception) // Change as follows return $this->renderApi($request, $exception); } }
贡献
您可以通过以下三种方式之一进行贡献
代码贡献过程并不十分正式。您只需确保遵循PSR-0、PSR-1和PSR-2编码指南。任何新的代码贡献都必须附带适用的单元测试。
许可证
MIT