soyhuce/laravel-rollbar 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

soyhuce/laravel-rollbar

Composer 安装命令:

composer require soyhuce/laravel-rollbar

包简介

Rollbar wrapper for Laravel

README 文档

README

alt text

Rollbar wrapper for Laravel

Installation

You can install the package via composer:

composer require soyhuce/laravel-rollbar

You can then add rollbar configuration in your config/logging.php

return [
    //...

    'channels' => [
        'rollbar' => [
            'driver' => 'monolog',
            'handler' => \Soyhuce\LaravelRollbar\LaravelRollbarHandler::class,
            'level' => env('LOG_LEVEL', 'error'),
            'access_token' => env('ROLLBAR_SERVER_KEY'),
        ],
    ],
];

You can add the configurations you need. See the Rollbar documentation for more information.

Customizing current user resolution

You can customize the current user resolution with \Soyhuce\LaravelRollbar\Facades\Rollbar::resolveAuthenticatedUserUsing(). You may want to add this in a service provider (for example AppServiceProvider).

\Soyhuce\LaravelRollbar\Facades\Rollbar::resolveAuthenticatedUserUsing(function (): array {
    $user = auth()->user();
    
    if ($user === null) {
        return [];
    }
    
    return [
        'id' => (string) $user->id, // id must be a string
        'role' => $user->role->label,
    ];
});

A default user resolver is provided in this package.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 832
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固