PHPackages                             pl/common - 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. pl/common

ActiveLibrary

pl/common
=========

1

0.11(7y ago)013PHP

Since May 13Pushed 7y ago1 watchersCompare

[ Source](https://github.com/qq2504021719/plcommon)[ Packagist](https://packagist.org/packages/pl/common)[ RSS](/packages/pl-common/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (3)Used By (0)

安装步骤
----

[](#安装步骤)

#### 1.下载

[](#1下载)

```
composer require pl/common

```

#### 2.`config\app.php`配置

[](#2configappphp配置)

```
'providers' => [
    ...,
    Pl\Common\CommonServiceProvider::class,
]
```

#### 3.composer更新

[](#3composer更新)

```
composer dump-autoload

```

#### 4.发布文件

[](#4发布文件)

```
php artisan vendor:publish --provider="Pl\Common\CommonServiceProvider"

```

1.项目错误信息发送邮件(示例)
----------------

[](#1项目错误信息发送邮件示例)

#### 1.`config\mail.php`邮箱配置,配置在.env文件中

[](#1configmailphp邮箱配置配置在env文件中)

```
MAIL_DRIVER=smtp
MAIL_HOST=smtp.exmail.qq.com
MAIL_PORT=465
MAIL_USERNAME=邮箱账号
MAIL_PASSWORD=邮箱密码
MAIL_ENCRYPTION=SSL

```

#### 2.`App\Exceptions\Handler`内`report`方法

[](#2appexceptionshandler内report方法)

> `post_email`方法参数查看源代码

```
use Pl\Common\Lib\MailCommon;

/**
 * Report or log an exception.
 *
 * @param  \Exception  $exception
 * @return void
 */
public function report(Exception $exception)
{
    $data = [];
    $data[0]['title'] = 'Message';
    $data[0]['text'] = $exception->getMessage();
    $data[1]['title'] = 'File';
    $data[1]['text'] = $exception->getFile();
    $data[2]['title'] = 'Line';
    $data[2]['text'] = $exception->getLine();
    $data[3]['title'] = 'Code';
    $data[3]['text'] = $exception->getCode();
    $data[4]['title'] = 'Previous';
    $data[4]['text'] = $exception->getPrevious();
    $data[5]['title'] = 'Trace';
    $data[5]['text'] = $exception->getTrace();
    $data[6]['title'] = 'TraceAsString';
    $data[6]['text'] = $exception->getTraceAsString();

    $MailCommon = new MailCommon();
    $MailCommon->post_email($data); // 调用发送邮件

    parent::report($exception);
}
```

License
-------

[](#license)

`pl/common` is licensed under [The MIT License (MIT)](LICENSE).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Every ~0 days

Total

2

Last Release

2559d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/pl-common/health.svg)

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

PHPackages © 2026

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