PHPackages                             joycezhang/laravellib - 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. [Database &amp; ORM](/categories/database)
4. /
5. joycezhang/laravellib

ActiveLibrary[Database &amp; ORM](/categories/database)

joycezhang/laravellib
=====================

Laravel 6|7|8|9|10 Repository,enum,model

2.4.8(2y ago)02341MITPHPPHP ^7.2|^8.1

Since Nov 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Joycezhangw/laravel-lib)[ Packagist](https://packagist.org/packages/joycezhang/laravellib)[ Docs](https://qilindao.github.io/docs/backend/)[ RSS](/packages/joycezhang-laravellib/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (9)Versions (29)Used By (0)

LaravelLib
==========

[](#laravellib)

LaravelLib 是`Laravel`专用个人使用包

[使用文档](https://qilindao.github.io/docs/backend/laravel-lib/index.html)

环境需求
----

[](#环境需求)

- PHP ≥ 7.0
- Laravel ≥ 6.x

安装
--

[](#安装)

```
composer require joycezhang/laravellib
```

生成配置文件
------

[](#生成配置文件)

```
php artisan vendor:publish --provider="JoyceZ\LaravelLib\ServiceProvider"
```

命名空间
----

[](#命名空间)

`\\JoyceZ\\LaravelLib\\`

Config 配置文件
-----------

[](#config-配置文件)

> 👋🏼 您当前浏览的文档为 2.x

```
return [
    'passport' => [//登录配置
        'check_captcha_cache_key' => 'captcha_uniqid',//图形key
        'password_salt' => env('LANDAO_PASSPORT_PASSWORD_SALT', env('APP_KEY'))//密码加密salt
    ],
    'crypt' => [//数据库可逆加密
        'screct_key' => env('LANDAO_CRYPT_SCRECT_KEY', env('APP_KEY'))
    ],
    'captcha' => [//图形验证码
        'charset' => 'abcdefghkmnprstuvwxyzABCDEFGHKMNPRSTUVWXYZ23456789',
        'codelen' => 4,
        'width' => 130,
        'height' => 50,
        // 为空为默认字体
        'font' => '',
        'fontsize' => 20,
        'cachetime' => 300,
    ],
    'paginate' => [//页数
        'page_size' => 20
    ],
    'generator' => [//Artisan 命令生成 Repository 和 enum 相关文件的指定根目录
        'basePath' => app()->path(),
        'rootNamespace' => 'App\\',
        'paths' => [
            'models' => 'Services\\Models',//model 生成根目录
            'repositories' => 'Services\\Repositories',//repository 生成根目录
            'interfaces' => 'Services\\Repositories',//repository interfaces 生成根目录。实际在生成中会转成 'App\Services\Repositories\Bolg\Interfaces\IPost.php
            'enums' => 'Services\\Enums',
        ]
    ]
];
```

Artisan 命令生成
------------

[](#artisan-命令生成)

> 👋🏼 您当前浏览的文档为 2.x

根目录配置，参见[Config 配置文件](#config-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6)

::: warning 提示 Artisan 命令生成的文件，会根据具体类型更改文件名：`PostEnum`、`PostModel`、`IPost`、`PostRepo`:::

Repository 命令生成
---------------

[](#repository-命令生成)

```
php artisan make:repository "Blog\Post"
```

执行以上命名会生成三个对应的文件如下

- `App\Services\Models\Bolg\PostModel.php`
- `App\Services\Repositories\Bolg\Interfaces\IPost.php`
- `App\Services\Repositories\Bolg\PostRepo.php`

Enum 命令生成
---------

[](#enum-命令生成)

```
php artisan make:enum "Blog\Post"
```

运行以上命令生成的文件结构为`App\Services\Enums\Bolg\PostEnum.php`

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity73

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

Recently: every ~10 days

Total

28

Last Release

802d ago

Major Versions

1.1.0 → 2.0.02022-08-17

PHP version history (3 changes)1.0.0PHP &gt;=7.0

2.0.0PHP ^7.2 || ^8.0

2.4.8PHP ^7.2|^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/3048d07dfca1169e5ea81c2f836bf9f53df6b24aa8220f57c7ace4f0c0d07d0b?d=identicon)[landao](/maintainers/landao)

---

Top Contributors

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

---

Tags

laravelrepositorylaravelenummodeleloquentcacherepository

### Embed Badge

![Health badge](/badges/joycezhang-laravellib/health.svg)

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[prettus/l5-repository

Laravel 8|9|10|11|12|13 - Repositories to the database layer

4.3k11.3M157](/packages/prettus-l5-repository)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.9k1](/packages/mike-bronner-laravel-model-caching)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)

PHPackages © 2026

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