PHPackages                             yisonli/laravel-helper - 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. yisonli/laravel-helper

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

yisonli/laravel-helper
======================

common functions for PHP developer, base on laravel framwork.

0.6(6y ago)217MITPHPPHP &gt;=7.0

Since Mar 15Pushed 6y ago1 watchersCompare

[ Source](https://github.com/yisonli/laravel-helper)[ Packagist](https://packagist.org/packages/yisonli/laravel-helper)[ RSS](/packages/yisonli-laravel-helper/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (7)Used By (0)

> Common functions for PHP developer, base on laravel framwork.

Install
-------

[](#install)

```
composer require yisonli/laravel-helper:0.6

```

Directory
---------

[](#directory)

```
.
├── README.md
├── composer.json
└── src
    ├── Crypt
    │   ├── AES.php
    │   ├── RSA.php
    │   └── Sign.php
    ├── Curl
    │   ├── Get.php
    │   ├── Post.php
    │   ├── PostJson.php
    │   ├── ResCode.php
    │   └── Response.php
    ├── Log
    │   ├── MonitorLog.php
    │   └── Sensitive.php
    └── Misc
        ├── ArrayHelper.php
        ├── Datas.php
        ├── Identity.php
        ├── Timestamp.php
        └── Verify.php

```

Config You Need
---------------

[](#config-you-need)

For debugging and checking, some methods use custom logs, so you need to add the following configuration to `.env` file. The specific log path can be configured on demand.

```
USE_MONITOR_LOG=1
MONITOR_ERROR_LOG=/tmp/${APP_NAME}/logs/%DATE%_error.log
MONITOR_WARN_LOG=/tmp/${APP_NAME}/logs/%DATE%_warn.log
MONITOR_INFO_LOG=/tmp/${APP_NAME}/logs/%DATE%_info.log

```

Usage
-----

[](#usage)

Now let's introduce the use of these functions.

### Crypt Functions

[](#crypt-functions)

【AES】

```
$aes = new AES($token);

$encrypted = $aes->encrypt($string);

$decrypted = $aes->decrypt($encrypted);

```

【Sign - The same as WeChat's sign】

```
$params['sign'] = Sign::getSign($params, $token);

$isValid = Sign::checkSign($params);

```

【RSA】

```
$rsa = new RSA($priKey, $pubKey, 'java');

$params['bizContent'] = $rsa->encrypt($bizContent);

$params['sign'] = $rsa->sign($params);

$isValid = $rsa->verify($params, $params['sign']);

$decrypted = $rsa->decrypt($result['bizContent'])

```

### Curl Functions

[](#curl-functions)

【Get】

```
$result = Get::run($url, $params, true);

```

【Post】

```
$result = Post::run($url, $params, true);

```

【PostJson】

```
$result = PostJson::run($url, $params, true);

```

【Response】

```
return Response::success($data, $header, $isHump);

return Response::error(array_merge(ResCode::ERR_LACK_PARAM, ['data'=>$errorMsg]));

return Response::fail(ResCode::ERR_THIRD_API_FAIL, 'something wrong.');

```

### Log Functions

[](#log-functions)

【MonitorLog】

```
MonitorLog::getInstance()->error($msg, $content);

MonitorLog::getInstance()->warn($msg, $content);

MonitorLog::getInstance()->info($msg, $content);

```

> If you want to filter the sensitive words from log message, you can add config `MONITOR_FILTER=true` to `.env` file.

【Sensitive】

```
$res_data = Sensitive::filter($data);

```

### Misc Functions

[](#misc-functions)

【ArrayHelper】

```
$array = [
    ['id' => '123', 'name' => 'aaa', 'class' => 'x'],
    ['id' => '124', 'name' => 'bbb', 'class' => 'x'],
    ['id' => '345', 'name' => 'ccc', 'class' => 'y'],
];
$result = ArrayHelper::map($array, 'id', 'name');

$result = ArrayHelper::map($array, 'id', 'name', 'class');

$array = [
    ['id' => '123', 'data' => 'abc'],
    ['id' => '345', 'data' => 'def'],
];
$result = ArrayHelper::index($array, 'id');

```

【Datas】

```
$string = Datas::lineToHump($string);

$string = Datas::humpToLine($string);

$result = Datas::arrayToHump($result);

$result = Datas::arrayToLine($result);

```

To be continue ...

About Me
--------

[](#about-me)

name: yison.li
blog:
github:

[![](https://camo.githubusercontent.com/9189daa8c40de78a9ec2ff983bf17eb59b57eac55442fa269e50c2e46ee7263a/687474703a2f2f79796565722e636f6d2f6173736574732f696d672f5969736f6e5765636861742e706e67)](https://camo.githubusercontent.com/9189daa8c40de78a9ec2ff983bf17eb59b57eac55442fa269e50c2e46ee7263a/687474703a2f2f79796565722e636f6d2f6173736574732f696d672f5969736f6e5765636861742e706e67)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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 ~72 days

Recently: every ~85 days

Total

6

Last Release

2252d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12879214?v=4)[yisonli](/maintainers/yisonli)[@yisonli](https://github.com/yisonli)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/yisonli-laravel-helper/health.svg)

```
[![Health](https://phpackages.com/badges/yisonli-laravel-helper/health.svg)](https://phpackages.com/packages/yisonli-laravel-helper)
```

###  Alternatives

[alb/oembed

oEmbed consumer library

1799.4k](/packages/alb-oembed)[jajuma/awesomehyva

This Magento 2 extension allows using Font Awesome 5 icons with Hyvä Themes

1349.1k](/packages/jajuma-awesomehyva)

PHPackages © 2026

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