naif/toggle-switch-field
最新稳定版本:2.0.0
Composer 安装命令:
composer require naif/toggle-switch-field
包简介
A Toggle Switch Field for Nova 4.
README 文档
README
Toggle Switch Field for Nova 4
For Toggle Switch Field for Nova 3 go to https://github.com/naifalshaye/toggle-switch
Features:
- Set custom color using hex color code.
- Toggle in Index and details to update value instead of icons. Default (true).
- Allow multiple toggles in same resource.
- Allow Disabled toggle (readonly) with Gray color.
Requirements
- PHP 8.0 or higher
- Nova 4
Installation
You can install the package into a Laravel app that uses Nova via composer:
composer require naif/toggle-switch-field
Usage
Table column migration
$table->boolean('toggle')->default(true);
* Add toggle fields to $fillable in Model
Add the field to Nova Resource
public function fields(NovaRequest $request)
{
return [
ToggleSwitchField::make('Toggle','toggle')
->color('#3AB95A')
->indexToggle(false)
->detailToggle(false),
];
}
Screenshots
Custom hex color code
Support:
Bug Tracker:
https://github.com/naifalshaye/toggle-switch-field/issues
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 51.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-11



