ffhs/filament-package_ffhs_custom_forms 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ffhs/filament-package_ffhs_custom_forms

Composer 安装命令:

composer require ffhs/filament-package_ffhs_custom_forms

包简介

Custom forms for Fernfachhochschule Schweiz (FFHS)

README 文档

README

This plugin enables you to create and manage nested forms within FilamentPHP.
It provides a wide range of customizable form fields and supports behavioral rules and templates.

Latest Version on Packagist
Total Downloads

Features:

  • Multiple Form Types: Bind forms to different use cases (e.g. entities) through customizable form types.
  • 🧩 General Fields: Define general fields for exports and reusability across form types.
  • 🛠 Configurable Field Types: Includes various fields like Repeaters to add additional inputs dynamically.
  • 🤏 drag & drop Use an intuitive form builder.
  • 🔁 Reactive Rules: Set up rules that react to answers by changing field visibility or modifying selectable options.
  • 🌟 Prioritized Select Field: Use enhanced select fields with prioritized or sorted options.
  • 📄 Template Snippets: Create reusable form templates to maximize reusability.
  • 🧱 Custom Components: Easily embed CustomForms into your application using Filament components.
  • 👁️ Multiple View Modes: Switch rendering styles based on where the form is used.
  • 🔧 Extensible Architecture: Everything is designed to be customizable, add your own fields, rules, and templates.
  • ⬇️ Import/Export: You can import and export custom forms directly from the UI..

Screenshots

Editor

Templates

Fill Form

View Form

Rule Editor

General Fields

Installation

  • Install the package via composer:
composer require ffhs/filament-package_ffhs_custom_forms^2.0
  • Publish and run the migrations:
php artisan vendor:publish --tag="filament-package_ffhs_custom_forms-migrations"  
php artisan migrate  
  • Publish the config file with:
php artisan vendor:publish --tag="filament-package_ffhs_custom_forms-config"  
  • Optionally, you can publish the views using
php artisan vendor:publish --tag="filament-package_ffhs_custom_forms-views"  

Simple Usage

  • Register the Plugin Add the plugin to your panel provider:
// App/Providers/Filament/xxPanelProvider   
  
->plugins([CustomFormPlugin::make()])  

Now you can try the Plugin in the Panel with the DefaultFormConfiguration.

Wiki

I'm sorry, but the Github wiki is not yet complete.

Features explained

✅ Form Configurations (FormTypes)

You can create different FormTypes, each with its own set of available FieldTypes and required **GeneralFields
**.
This allows you to customize forms for different application scenarios.

For example, you might have custom forms for requests and custom forms for applications. Now you can create two
different FormTypes:

  • One requires a general field for the study location
  • The other does not include this field

This makes the form system flexible and reusable across various use cases.

CustomFields

A CustomField consists of:

  • A FieldType – Defines the type and logic of the field (e.g. TextType, SelectType, etc.).
  • A set of Options – Configuration values such as placeholder text, min/max values, selectable choices, etc.
  • A FieldTypeView – Which can change on a different ViewMode

Predefined Field Types

📥 Input Fields

  • TextType::class
  • EmailType::class
  • NumberType::class
  • TextAreaType::class
  • DateTimeType::class
  • DateType::class
  • DateRangeType::class
  • FileUploadType::class
  • CheckboxType::class

🔘 Choice Fields

  • SelectType::class
  • RadioType::class
  • CheckboxListType::class
  • ToggleButtonsType::class

✨ Special Fields

  • TagsType::class
  • KeyValueType::class
  • ColorPickerType::class
  • IconSelectType::class

📐 Layout Components

  • SectionType::class
  • FieldsetType::class
  • GroupType::class
  • TitleType::class
  • TextLayoutType::class
  • DownloadType::class
  • ImageLayoutType::class
  • SpaceType::class
  • RepeaterLayoutType::class

TypeOptions

The TypeOptions are options components which can add to a field-type to modify the components.
The TypeOptions can automatically apply some effects if the
return $input = $this->makeComponent(TextInput::class, $record); is used in the TypeView.

Predefined Type Option Classes

These classes define configurable TypeOptions used in CustomFormFields.

  1. ActionLabelTypeOption.php
  2. AllowedFileTypeOption.php
  3. AlpineMaskOption.php
  4. AmountOption.php
  5. AsideOption.php
  6. BooleanOption.php
  7. ColorTypeOption.php
  8. ColumnsOption.php
  9. ColumnSpanOption.php
  10. DateFormatOption.php
  11. DefaultAmountOption.php
  12. Downloadable.php
  13. FastTypeOption.php
  14. GridLayoutOption.php
  15. GroupedOption.php
  16. HelperTextTypeOption.php
  17. HiddenLabelOption.php
  18. IconOption.php
  19. ImaginaryTypeOption.php
  20. InLineLabelOption.php
  21. InLineOption.php
  22. MaxAmountOption.php
  23. MaxLengthOption.php
  24. MaxSelectOption.php
  25. MaxValueOption.php
  26. MinAmountOption.php
  27. MinLengthOption.php
  28. MinSelectOption.php
  29. MinValueOption.php
  30. MultipleOption.php
  31. NewLineOption.php
  32. OpenInNewTabOption.php
  33. PreserveFilenamesOption.php
  34. RelatedFieldOption.php
  35. ReorderableTypeOption.php
  36. RequiredOption.php
  37. SeveralOption.php
  38. ShowAsFieldsetOption.php
  39. ShowAsFieldsOption.php
  40. ShowImagesOption.php
  41. ShowInViewOption.php
  42. ShowLabelOption.php
  43. ShowLinkOption.php
  44. SuggestionsOption.php
  45. TextOption.php
  46. ValidationAttributeOption.php
  47. ValidationMessageOption.php

Using TypeOptions in a CustomFieldType

You can add extra type options to your custom field by overriding extraTypeOptions() or generalTypeOptions():

// MyType.php  
public function extraTypeOptions(): array  {    
    return [    
       'alpine_mask' => AlpineMaskOption::make()  
           ->modifyDefault(fn($oldDefault) => '...'),    
       'max_length' => MaxLengthOption::make()  
           ->modifyOptionComponent(fn($component) => $component->columnStart(1)),      
       'min_length' => MinLengthOption::make(),    
    ];    
}  
  • Each key represents the option name.
  • The value is an instance of a TypeOption, usually created via ::make().
  • You can customize how the option behaves using methods like modifyDefault() or modifyOptionComponent().

Use FastTypeOption

FastTypeOption allows you to quickly add custom options directly in your FieldType and react to them in your
FieldTypeView.

//MyType.php  
public function extraTypeOptions(): array  {    
    return [    
       'my_option' => FastTypeOption::makeFast(    
           default: false,    
           fn($name) => Toggle::make($name)  
       )  
    ];    
}  
// MyTypeView.php  
$myOption = $this->getOptionParameter($record, 'my_option');  
  
/** @var TextInput $input */    
$input = $this->makeComponent(TextInput::class, $record);  
  
if($myOption){  
    $input->modify(...);  
}  
  
return $input  

OptionsGroups

OptionsGroups help organize multiple related TypeOptions into logical collections,
making your field configuration cleaner and easier to manage.

In the image TypeOptions are marked red and the OptionGroups are marked blue.

How to use OptionGroups?

//MyType.php  
public function extraTypeOptions(): array  {    
    return [    
        TypeOptionGroup::make('MyGroup', [    
           'alpine_mask' => AlpineMaskOption::make(),    
          'max_length' => MaxLengthOption::make(),    
          'min_length' => MinLengthOption::make(),  
       ]),  
       ValidationTypeOptionGroup::make(),    
        LayoutOptionGroup::make()  
           ->mergeTypeOptions([    
              'my_option' => MyTypeOption::make(),    
          ])  
          ->removeTypeOption('...'),  
    ];    
}  

Rules: Events and Triggers

Rules can be divided into events and triggers. Triggers cause events to be executed. A rule can consist of multiple
triggers that can be combined using 'AND' or 'OR' logic and can execute multiple events.

Predefined Events

  • HideEvent
  • VisibleEvent
  • DisabledEvent
  • RequiredEvent
  • ChangeOptionsEvent

Predefined Triggers

  • IsInfolistTrigger
  • ValueEqualsRuleTrigger
  • AlwaysRuleTrigger

Embed CustomForms

You can embed CustomForms or their answers in various parts of your application using specialized components. Below are
examples of usage patterns and customization options.

Testing

./vendor/bin/testbench vendor:publish --tag="filament-package_ffhs_custom_forms-migrations"    
./vendor/bin/testbench workbench:build  
./vendor/bin/pest test    

Postcards

We highly appreciate you sending us a postcard.
You'll find our address on our page.

License

The MIT License (MIT). Please see License File for more information.

ffhs/filament-package_ffhs_custom_forms 适用场景与选型建议

ffhs/filament-package_ffhs_custom_forms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 113 次下载、GitHub Stars 达 17, 最近一次更新时间为 2025 年 07 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「ffhs」 「filament-package_ffhs_custom_forms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ffhs/filament-package_ffhs_custom_forms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ffhs/filament-package_ffhs_custom_forms 我们能提供哪些服务?
定制开发 / 二次开发

基于 ffhs/filament-package_ffhs_custom_forms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

与 ffhs/filament-package_ffhs_custom_forms 相关的其它包

同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:

统计信息

  • 总下载量: 113
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 17
  • 点击次数: 13
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 17
  • Watchers: 0
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-10