定制 rob-lester-jr04/laravel-health-expansion 二次开发

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

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

rob-lester-jr04/laravel-health-expansion

Composer 安装命令:

composer require rob-lester-jr04/laravel-health-expansion

包简介

An expansion pack for Spatie Laravel Health package

README 文档

README

Latest Version on Packagist PHP Composer Total Downloads

Using this package to add more health checks to Spatie Health Checks for Laravel.

Installation

composer require rob-lester-jr04/laravel-health-expansion

Laravel will automatically register the service provider.

Here's an example where we'll monitor errors in PaperTrail.

// typically, in a service provider

use Spatie\Health\Facades\Health;
use Lester\Health\Checks\Checks\PaperTrailCheck;

Health::checks([
	PaperTrailCheck::new()
		->onSystem('my-system-1'),
]);

By default, this will report a failure if there are more than 20 errors in the default time frame (10 minutes). It will report a warning if there are more than 10, and it will report as ok if the error count is under 10. The thresholds can be changed with the following methods:

...highCount();
...lowCount();

// Change time frame (in minutes)
...lastMinutes();

Available Checks

This package also contains the following checks:

  • MailgunDomainCheck
    • This check will get the status for your mailgun domain(s) so you can monitor if mailgun has flagged your deliverability.
  • ApiCheck
    • This check allows you to get the laravel health from another application. Useful for creating a permenant dashboard screen that monitors all your other systems.
  • PaperTrailCheck
    • Scans PaperTrail logs for a set number of errors in a set time frame.

Using the MailGun domain check

First, set the API key in the .env file.

	MAILGUN_SECRET=########

Then enable the check in the service provider

use Spatie\Health\Facades\Health;
use Lester\Health\Checks\Checks\MailgunDomainCheck;

Health::checks([
	// ...
	
	MailgunDomainCheck::new()
		->domain('mg.example.com'),
		
	// ...
]);

Testing

composer test

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固