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
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-22