laravel报表辅助函数的附加参数

laravel报表辅助函数的附加参数,laravel,Laravel,我想为laravels report helper函数提供一个附加参数,以便可以这样调用它: report($exception, 'Some additional info'); 因此,我更改了app/Exceptions/Handler类: public function report(Exception $exception, string $message = null) { if($message) { SendErrorMails::raw($message

我想为laravels report helper函数提供一个附加参数,以便可以这样调用它:

report($exception, 'Some additional info');
因此,我更改了app/Exceptions/Handler类:

public function report(Exception $exception, string $message = null)
{
    if($message) {
        SendErrorMails::raw($message, $exception->getMessage());
    }
    parent::report($exception);
}

但是IDE仍然抱怨它只接受1个参数。

异常处理程序的
报告
帮助程序不是
报告
方法

您必须像这样创建自己的助手

function customReport(Exception $exception, string $message = null) {
    // Call the exception handler report method here
}

有关更多信息,请参阅
报告
帮助程序代码。

您使用的是什么IDE?@RossWilson phpstorm是否也添加了新的帮助程序函数?如果没有,您使用的是什么版本的Laravel?没有,我没有更改报告功能的任何内容。我假设它只会映射到处理程序类中的report方法,但不幸的是,不是这样。Laravel如何定义其全局辅助函数并没有什么神奇之处。您使用的是什么版本的Laravel?