PHPackages                             liiker/zzld-foundation - 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. liiker/zzld-foundation

ActiveLibrary

liiker/zzld-foundation
======================

nxzzld.com's founcation module

v0.1.0.x-dev(8y ago)018CSS

Since Aug 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/liiker/zzld-foundation)[ Packagist](https://packagist.org/packages/liiker/zzld-foundation)[ RSS](/packages/liiker-zzld-foundation/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

ZZLD-Foundation
===============

[](#zzld-foundation)

> 注意:本框架以Laravel 5.3 为基础进行开发。此版本为开发预览版，接口及功能已经趋于稳定，但是部分功能还未实现

中正联达基础框架，主要包括以下功能:

1. 基于模型配置的后端管理脚手架(常规的CRUD 功能)
2. 基于角色的权限管理(用户 角色 部门 职位)

安装
--

[](#安装)

#### 安装包文件

[](#安装包文件)

```
composer require "liiker/zzld-foundation:*"
```

> 注意:由于本项目暂时为放到[github](http://github.com) 而且没有同步到 [packagist](https://packagist.org) 上面，所以暂时无法通过此方法进行安装

#### 本地安装

[](#本地安装)

1. 将扩展包项目通过git同步到本地的任意路径下，比如: /home/users/path/packages

```
git clone git@git.oschina.net:nxzzld/packages.git
```

2. 修改composer.json文件添加本地 repository

```
repositories:[
  {
	  type: path,
	  url: /home/users/path/packages/* //status==2){
            return 'warning';
        }else if($row->status==0){
            return 'danger';
        }
    }

    /**
     * 设置行 style
     */
    public function row_style($row){
        return "";
    }

    /**
     * 表单校验, 使用laravel框架默认校验规则
     */
    public function rule(){
        return [
            'name' => 'required|min:6|max:50',
            'password' => 'required|min:6',
            'email' => 'required|email',
        ];
    }

    public function before_save(){
        if($this->password){
            $this->password = Hash::make($this->password);
        }
    }

    public function before_update(){
        if($this->password){
            $this->password = Hash::make($this->password);
        }
    }

	//外键关联
	public function role(){
		return $this->belongsTo('Zzld\Foundation\Models\Role');
	}

	//外键关联
	public function department(){
		return $this->belongsTo('Zzld\Foundation\Models\Department');
	}

	//外键关联
	public function position(){
		return $this->belongsTo('Zzld\Foundation\Models\Position');
	}

    /**
     * 配置字段展示属性
     */
    public function admin_field(){
        return [
            'name' => [
                'label' => '姓名',
                'tip' => '*此项目必填',
            ],

            'account' => [
                'label' => '帐号',
            ],

            'email' => [
                'label' => '邮箱',
            ],

            'password' => [
                'label' => '密码',
                'field_wrapper' => function($val){
                    return "****";
                }
            ],

            'status' => [
                'label' => '状态',
                'widget' => [
                    'name' => 'selector',
                    'options' => [
                        '0' => '禁用',
                        '1' => '启用',
                        '2' => '密码过期',
                    ],
                    'nullable' => false,
                ],
                'field_wrapper' => function($val){
                    if($val==0){
                        return "";
                    }else if($val==1){
                        return "";
                    }else if($val==2){
                        return "";
                    }
                }
            ],

            'last_login' => [
                'label' => '最后登陆时间',
                'widget' => [
                    'name'=>'datetimepicker',
                    'type'=>'date',
                    'format'=>'yyyy-mm-dd HH:ii:ss',
                ],
            ],

            'remember_token' => [
                'label' => '记住我Token',
                'widget' => [
                    'name' => 'upload',
                    'type' => 'file',
                    'options' => '{"size":1024000, "ext":"pdf|txt|doc|xls"}', //json格式描述数据:主要用来限制文件大小和文件类型
                ],
            ],

			'role' => [
				'label' => '角色',
				'virtual' => true,
			]

        ];
    }
    public function __toString(){
        return $this->name;
    }
}

```

#### 字段类型

[](#字段类型)

##### 普通文本:

[](#普通文本)

##### 外键(模型):

[](#外键模型)

参考实例

```
 'type_id' => [
     'link' => 'dishestype',
     'label' => '菜品类型',
     'model' => [
         'name' => 'dishestype',
         'bind_field' => 'name',
         'key' => 'id',
         /*
         'list' => function(){
             return DishesType::all();
         }
         ┊*/
     ],
 ],

```

> 配置属性说明
>
> 1. link 在列表中这个字段中显示链接，与对应的数据进行关联（以脚手架形式进行展示）
> 2. model 外键关联的模型
> 3. model.name 外键关联的模型
> 4. model.bind\_field 编辑和添加页面中外键下拉框对应显示的属性
> 5. model.key 编辑和添加页面中外键下拉框对应的值
> 6. model.list 如果编辑和添加中显示的是某个外表中一部分数据可以通过list来指定，list是一个方法，返回的是laravel模型信息

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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

3179d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0786425bf68f88e4378e8554789a4fc29f03bc218aa1b5e4a1a87773b4fbe1f2?d=identicon)[liiker](/maintainers/liiker)

---

Top Contributors

[![Eric-Yang](https://avatars.githubusercontent.com/u/1688090?v=4)](https://github.com/Eric-Yang "Eric-Yang (2 commits)")[![liiker](https://avatars.githubusercontent.com/u/904709?v=4)](https://github.com/liiker "liiker (1 commits)")

### Embed Badge

![Health badge](/badges/liiker-zzld-foundation/health.svg)

```
[![Health](https://phpackages.com/badges/liiker-zzld-foundation/health.svg)](https://phpackages.com/packages/liiker-zzld-foundation)
```

###  Alternatives

[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[abydahana/aksara

Aksara is a CodeIgniter based CRUD Toolkit you can use to build complex applications become shorter, secure and more reliable just in a few lines of code. Serving both CMS or Framework, produce both HEADLESS (RESTful API) or TRADITIONAL (Browser Based), just by writing single controller. Yet it's reusable, scalable and ready to use!

1101.2k](/packages/abydahana-aksara)

PHPackages © 2026

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