cbLink/laravel-exception

包描述在这里。

v0.1.1 2023-02-06 02:09 UTC

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);
    }
}

贡献

您可以通过以下三种方式之一进行贡献

  1. 使用问题跟踪器提交错误报告。
  2. 问题跟踪器上回答问题或修复错误。
  3. 贡献新功能或更新wiki。

代码贡献过程并不十分正式。您只需确保遵循PSR-0、PSR-1和PSR-2编码指南。任何新的代码贡献都必须附带适用的单元测试。

许可证

MIT