lopatin96/lara-enum 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

lopatin96/lara-enum

最新稳定版本:1.0.2

Composer 安装命令:

composer require lopatin96/lara-enum

包简介

README 文档

README

Installation

You can install this package via composer:

composer require lopatin96/lara-enum

How to use

Publish config and local files:

php artisan vendor:publish --tag="lara-enum-config"
php artisan vendor:publish --tag="lara-enum-lang"

Config

Add key-value to lara-enum config file:

return [

    'document-status' => [
        'color' => [
            'pending' => 'amber',
            'in_progress' => 'blue',
            'in_progress_pending' => 'blue',
            'finished' => 'green',
            'error' => 'red',
        ],
    ],

];

and call $document->status->getColorProperty().

Local

Add key-value to lara-enum local file:

return [

    'document-status' => [
        'label' => [
            'pending' => 'Pending',
            'in_progress' => 'In progress',
            'in_progress_pending' => 'In progress',
            'finished' => 'Finished',
            'error' => 'Error',
        ],
    ],

];

and call $document->status->getLabelLocal().

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-22