defstudio/filament-dynamic-actions
最新稳定版本:v4.0.5
Composer 安装命令:
composer require defstudio/filament-dynamic-actions
包简介
Dynamically disable or hide actions when form is dirty
README 文档
README
Want to enable/disable a Filament action when the form is dirty/unsaved? With this package, it will be as easy as:
\Filament\Actions\Action::make('download') ->icon('heroicon-o-document-arrow-down') ->action(function($record){...}) ->disabledWhenDirty()
all with Alpine, no need of extra livewire requests to the backend
Installation
You can install the package via composer:
composer require defstudio/filament-dynamic-actions
You can publish the translations files with:
php artisan vendor:publish --tag="filament-dynamic-actions-translations"
Usage
This package simply adds a new method to the page actions that allows to disable it when the form is dirty (all parameters are optional, default values will be used if missing):
\Filament\Actions\Action::make('download') ->icon('heroicon-o-document-arrow-down') ->action(function($record){...}) ->disabledWhenDirty( message: "oops! There are unsaved changes", disabledClass: 'disabled:opacity-100 disabled:bg-red-500', ignoredFields: [ 'path.also_with_subpath.of.a.field.i_dont_care_to_check' ] )
Changelog
Please see CHANGELOG for more information on what has changed recently. Follow Us on Twitter for more updates about this package.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 1.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-20