定制 encodia/laravel-something-wrong 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

encodia/laravel-something-wrong

最新稳定版本:1.0.0

Composer 安装命令:

composer require encodia/laravel-something-wrong

包简介

A simple package for Laravel to notify handled errors, exceptions and more

README 文档

README

Abandoned Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status

Total Downloads

⚠️ Package deprecated

This package is no longer maintained. Please consider using alternatives or forking it if needed.

A simple package for Laravel to notify handled errors, exceptions and more.

Note: this package is still under development and currently its features are very limited.

Installation

You can install the package via composer:

composer require encodia/laravel-something-wrong

You can publish the config file with:

php artisan vendor:publish --tag="laravel-something-wrong-config"

Usage

Note: the current version only supports Insight Hub (formerly Bugsnag).

This means that anything you notify will use Insight Hub under the hood to send a notification.

Where

Typically, you will inject Encodia\SomethingWrong in your service class constructor:

use \Encodia\SomethingWrong;

class MyService {
    private SomethingWrong $somethingWrong;

    public function __construct(SomethingWrong $somethingWrong)
    {        
        $this->somethingWrong = $somethingWrong;
    }
    
    public function doSomething(): void
    {
        // ...
        $this->somethingWrong
            ->exception(
                new \Exception("This wasn't supposed to happen, so let's notify it!")
        );
        
        // ...        
    }
}

    

If you prefer, you can use its facade:

use \Encodia\SomethingWrong\Facades\SomethingWrong;

// ...
SomethingWrong::exception(
    new \Exception("This wasn't supposed to happen, so let's notify it!")
);

How

You can notify a simple exception, without any further details:

SomethingWrong::exception(
    new \Exception("Something wrong happened!")
);

If you need to add any details, just pass an array as second argument:

SomethingWrong::exception(
    new \Exception("Something wrong happened!"),
    [
        'foo' => 'bar',
        'path' => 'a/b/c',
        'user' => auth()->user,
    ],
);

Testing

composer test

Changelog

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

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固