programic/laravel-tools

Laravel 扩展

v3.1.1 2024-03-22 10:39 UTC

This package is auto-updated.

Last update: 2024-08-31 12:01:23 UTC


README

Latest Version on Packagist Tests Total Downloads

此包是 Laravel 扩展

安装

此包需要 PHP 5.6 和 Laravel 5.0 或更高版本。

composer require programic/laravel-tools

使用方法

Sentry

Laravel 11+

将此链添加到 bootstrap/app.php 中的 Application 中

->withExceptions(function (Exceptions $exceptions) {
    Integration::handles($exceptions);
})

Laravel 8 - 10

替换 App\Exceptions\Handler 中的 report 方法

public function report(Exception $exception)
{
    if ($this->shouldReport($exception) && app()->bound('sentry')) {
        app('sentry')->captureException($exception);
    }

    parent::report($exception);
}

MySQL 支持

在您的 config/app.php 中添加 Mysql8ServiceProvider 以添加对迁移的 MySQL 8 支持

将调试数据添加到 API 响应中

Programic\Tools\Middleware\DebugBarMeta 添加为您的 API 组 App/Http/Kernel.php 中的中间件,以将调试数据添加到每个响应中

Vue 包

使用我们的 Vue 插件将此调试数据添加到 Vue Devtools: https://github.com/programic/api-debugbar-vue-devtools

测试

composer test

变更日志

有关最近更改的更多信息,请参阅 CHANGELOG

贡献

有关详细信息,请参阅 CONTRIBUTING

安全性

如果您发现任何与安全性相关的问题,请通过电子邮件 info@programic.com 联系我们,而不是使用问题跟踪器。

鸣谢

许可

MIT 许可证 (MIT)。有关更多信息,请参阅 许可文件