PHPackages                             larawei/serverchan - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. larawei/serverchan

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

larawei/serverchan
==================

🍬Serve酱的PHP扩展包

0.01(7y ago)713MITPHP

Since Sep 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Larawei/serverchan)[ Packagist](https://packagist.org/packages/larawei/serverchan)[ RSS](/packages/larawei-serverchan/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

 🍬ServerChan
=============

[](#-serverchan-)

 Server酱的PHP扩展包.

 「Server酱」，英文名「ServerChan」，是一款「程序员」和「服务器」之间的通信软件。

说人话？就是从服务器推报警和日志到手机的工具。

\---摘自Server酱官网介绍

配置
--

[](#配置)

前往 [Server酱](http://sc.ftqq.com/3.version) 申请 `sckey`

安装
--

[](#安装)

```
$ composer require larawei/serverchan -vvv
```

使用
--

[](#使用)

```
use Larawei\Serverchan\ServerChan;

$key = 'xxxxxxxxxxxxxxxxxxxxxxxxx';

$serverChan = new ServerChan($key);
```

### 发送信息

[](#发送信息)

```
$response = $serverChan->send('系统出Bug啦~', '(╯‵□′)╯︵┻━┻');
```

示例：

```
Array
(
    [errno] => 0
    [errmsg] => success
    [dataset] => done
)

```

### 在 Laravel 中使用

[](#在-laravel-中使用)

在 Laravel 中使用也是同样的安装方式，配置写在 `config/services.php` 中：

```
    .
    .
    .
    'serverChan' => [
        'key' => env('SERVER_CHAN_KEY'),
    ],
```

然后在 `.env` 中配置 `SERVER_CHAN_KEY` ：

```
SERVER_CHAN_KEY=xxxxxxxxxxxxxxxxxxxxx
```

可以用两种方式来获取 `Larawei\Serverchan\ServerChan` 实例：

#### 方法参数注入

[](#方法参数注入)

```
    .
    .
    .
    public function notify(ServerChan $serverChan)
    {
        $response = $serverChan->send('系统出Bug啦~', '(╯‵□′)╯︵┻━┻');
    }
    .
    .
    .
```

#### 服务名访问

[](#服务名访问)

```
    .
    .
    .
    public function notify()
    {
        $response = app('serverChan')->send('系统出Bug啦~', '(╯‵□′)╯︵┻━┻');
    }
    .
    .
    .
```

#### 通知Laravel系统异常

[](#通知laravel系统异常)

在`app/Exceptions/Handler.php`的`report`添加

```
$title = '['.config('app.name').'('.config('app.env').')]时间:' . Carbon::now()->toDateTimeString() . '信息:' .$exception->getMessage(). 'url: '.request()->fullUrl();
$content = sprintf("```
    %s
```", $exception->getTraceAsString());
app('serverChan')->send($title, $content);
```

License
-------

[](#license)

MIT

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2810d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b741067d29feb40b436198353df28c9d465dbb5dd4484be2402dac9f68a05d77?d=identicon)[LaraWei](/maintainers/LaraWei)

---

Top Contributors

[![Larawei](https://avatars.githubusercontent.com/u/16457886?v=4)](https://github.com/Larawei "Larawei (3 commits)")

### Embed Badge

![Health badge](/badges/larawei-serverchan/health.svg)

```
[![Health](https://phpackages.com/badges/larawei-serverchan/health.svg)](https://phpackages.com/packages/larawei-serverchan)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
