laravel 的异常报告工具

v1.0.5 2023-06-28 18:49 UTC

This package is auto-updated.

Last update: 2024-09-28 21:29:37 UTC


README

此工具将异常信息存储到数据库中,并提供一个面向开发者的网页界面来查看异常信息。

StyleCI Packagist Total Downloads Pull request welcome

截图

laravel-admin_exceptions

安装

$ composer require laravel-admin-reporter/reporter -vvv

$ php artisan vendor:publish --tag=laravel-admin-reporter

$ php artisan migrate --path=vendor/laravel-admin-reporter/reporter/database/migrations


$ php artisan admin:import reporter

打开 app/Exceptions/Handler.php 文件,在 report 方法中调用 Reporter::report()

<?php

namespace App\Exceptions;

use Encore\Admin\Reporter\Reporter;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Validation\ValidationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
    ...

    public function report(Exception $exception)
    {
        if ($this->shouldReport($exception)) {
            Reporter::report($exception);
        }

//        parent::report($exception);
    }
    
    ...

}

打开 https:///admin/exceptions 来查看异常。

许可证

MIT 许可证 (MIT) 下授权。