定制 wboyz/laravel-enum 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wboyz/laravel-enum

最新稳定版本:v0.2.1

Composer 安装命令:

composer require wboyz/laravel-enum

包简介

Base enum class with some features.

README 文档

README

License Latest Stable Version

Create a base enum class to laravel framework.

Installation

Require this package with composer:

composer require wboyz/laravel-enum

General Use

use WBoyz\LaravelEnum\BaseEnum;

class Fruits extends BaseEnum
{
    const APPLE = 1;
    const PEACH = 2;
    const PEAR = 3;
}

...

$values = Fruits::getValues();
// [1, 2, 3]

$keys = Fruits::getKeys();
// ['APPLE', 'PEACH', 'PEAR']

$dictionary = Fruits::toDictionary();
// ['APPLE' => 1, 'PEACH' => 2, 'PEAR' => 3]

$result = Fruits::hasValue(1);  
// true

$result = Fruits::hasKey('APPLE');
// true

$result = Fruits::getValue('APPLE');
// 1

$result = Fruits::getValue('MELON');
// 0

统计信息

  • 总下载量: 12.32k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-02