coreproc/nova-toggle-fields
最新稳定版本:v1.0.1
Composer 安装命令:
composer require coreproc/nova-toggle-fields
包简介
A Laravel Nova action that enables you to toggle fields on the index of your resource.
README 文档
README
A Laravel Nova package that enables you to toggle fields on the index of your resource through a standalone action.
Installation
You can install the package into a Laravel app that uses Nova via composer:
composer require coreproc/nova-toggle-fields
Usage
To use the toggle fields action, you need to first add the HasToggleableFields trait to your resource:
use Coreproc\NovaToggleFields\Traits\HasToggleableFields; class Contact extends Resource { use HasToggleableFields; ..... }
Then add the the ToggleFields action class inside the actions method along with the parameters:
use Coreproc\NovaToggleFields\Traits\HasToggleableFields; class Contact extends Resource { use HasToggleableFields; ..... /** * Get the actions available for the resource. * * @param \Laravel\Nova\Http\Requests\NovaRequest $request * @return array */ public function actions(NovaRequest $request) { return [ (new ToggleFields(self::class, $this->indexFields($request))), ]; } ... }
统计信息
- 总下载量: 49
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-05
