PHPackages                             smallruraldog/laravel-custom - 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. smallruraldog/laravel-custom

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

smallruraldog/laravel-custom
============================

2.0(7y ago)21.0k2PHP

Since May 15Pushed 7y ago1 watchersCompare

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

READMEChangelog (2)DependenciesVersions (5)Used By (2)

laravel-custom
==============

[](#laravel-custom)

laravel 5.5+ 一些自定义的扩展帮助工具

### 安装

[](#安装)

首先确保安装好了laravel

```
composer require smallruraldog/laravel-custom

```

然后运行下面的命令来发布资源：

```
php artisan vendor:publish --provider="SmallRuralDog\LaravelCustom\LaravelCustomServiceProvider"

```

生成配置文件 安装完成之后，所有的配置都在`config/laravel-custom.php`文件中。

### 功能列表

[](#功能列表)

- api自定义返回工具
- API 资源扩展

#### api返回工具使用

[](#api返回工具使用)

`App\Exceptions\Handler`的`render`方法

```
public function render($request, Exception $exception)
    {
        $report = LaravelCustom::ExceptionReport($exception);
        if ($report) {
            return $report;
        }
        return parent::render($request, $exception);
    }
```

异常拦截自定义

```
//[message:自定义消息,code:状态码,status:状态]
'do-report' => [
     \Illuminate\Auth\AuthenticationException::class => ['用户未授权', 401, 'error']
 ]
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

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

Total

4

Last Release

2666d ago

Major Versions

1.0.2 → 2.02019-01-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/675dd15fd62ee78fa0b66e1dc8fdbd29555ff61fa48aa633ff26c7eac7806624?d=identicon)[SmallRuralDog](/maintainers/SmallRuralDog)

---

Top Contributors

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

---

Tags

laravellaravel-package

### Embed Badge

![Health badge](/badges/smallruraldog-laravel-custom/health.svg)

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

###  Alternatives

[lee-to/laravel-seo-by-url

Easy seo for Laravel and MoonShine

239.4k](/packages/lee-to-laravel-seo-by-url)

PHPackages © 2026

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