anish/clearfield-action
Composer 安装命令:
composer require anish/clearfield-action
包简介
A Filament action that allows users to quickly reset all form fields with customizable confirmation dialogs and notifications.
README 文档
README
A Filament action that allows users to quickly reset all form fields with customizable confirmation dialogs and notifications.
Features
- One-click form field clearing
- Customizable icons and colors
- Optional confirmation dialog
- Success notifications
- Works with Create and Edit pages
- Customizable callbacks (before/after reset)
- Compatible with Filament v4 & v5
Requirements
- PHP 8.1+
- Filament 4.0+ | 5.0+
- Laravel 10+
Installation
You can install the package via Composer:
composer require anish/clearfield-action
Usage
Basic Usage
Add ClearFieldAction to your resource page's create record or edit record header actions:
<?php namespace App\Filament\Resources\Users\Pages; use Filament\Resources\Pages\CreateRecord; use App\Filament\Resources\Users\UserResource; use Anish\ClearFieldAction\Actions\ClearFieldAction; class CreateUser extends CreateRecord { protected static string $resource = UserResource::class; protected function getHeaderActions(): array { return [ ClearFieldAction::make(), ]; } }
With Confirmation
ClearFieldAction::make() ->requiresConfirmation() ->confirmationTitle('Clear Form Fields?') ->confirmationDescription('Are you sure you want to clear all form fields?')
Custom Notification
ClearFieldAction::make() ->notificationTitle('Fields Cleared') ->notificationBody('All form fields have been reset successfully.')
With Callbacks
ClearFieldAction::make() ->beforeReset(function ($livewire) { // Execute before clearing fields Log::info('Clearing form fields'); }) ->afterReset(function ($livewire) { // Execute after clearing fields Log::info('Form fields cleared'); })
Hide Notification
ClearFieldAction::make() ->showNotification(false)
Custom Icon and Color
ClearFieldAction::make() ->icon('heroicon-o-x-mark') ->color('danger') ->label('Clear All')
Configuration
Publish the config file to customize default settings:
php artisan vendor:publish --tag=clearfield-action-config
Available configuration options:
icon- Default icon for the actioncolor- Default color schemelabel- Default label texttooltip- Default tooltip textrequires_confirmation- Whether to show confirmation by defaultconfirmation_title- Default confirmation dialog titleconfirmation_description- Default confirmation dialog descriptionshow_notification- Whether to show notification by defaultnotification_title- Default notification titlenotification_body- Default notification body
Available Methods
requiresConfirmation(bool|Closure $condition)- Enable/disable confirmation dialogconfirmationTitle(string|Closure|null $title)- Set confirmation dialog titleconfirmationDescription(string|Closure|null $description)- Set confirmation dialog descriptionbeforeReset(Closure $callback)- Callback executed before clearing fieldsafterReset(Closure $callback)- Callback executed after clearing fieldsshowNotification(bool|Closure $show)- Show/hide success notificationnotificationTitle(string|Closure|null $title)- Set notification titlenotificationBody(string|Closure|null $body)- Set notification bodyicon(string $icon)- Set action iconcolor(string $color)- Set action colorlabel(string|null $label)- Set action labeltooltip(string $tooltip)- Set action tooltip
Compatibility
This package supports:
- Filament v4.0+
- Filament v5.0+
License
MIT
Author
anishregmi17
anish/clearfield-action 适用场景与选型建议
anish/clearfield-action 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 183 次下载、GitHub Stars 达 2, 最近一次更新时间为 2026 年 01 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「laravel-package」 「filament」 「filament-component」 「clearfield-action」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 anish/clearfield-action 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 anish/clearfield-action 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 anish/clearfield-action 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel package for converting English numbers into Bangla digits, Bangla words, Bangla month names, and Bangla money format with an easy-to-use API.
Laravel table comments loader (part of Diplodocker project)
jitone-ai is a powerful FilamentPHP plugin that integrates AI-powered features directly into your Filament forms.
Laravel JWT auth service package
Laravel package for Kavenegar sms
Alfabank REST API integration
统计信息
- 总下载量: 183
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-03