Download the PHP package ffhs/filament-package_ffhs_custom_forms without Composer

On this page you can find all versions of the php package ffhs/filament-package_ffhs_custom_forms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-package_ffhs_custom_forms

CustomForms Overview

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:


Screenshots

Editor


Templates


Fill Form

View Form


Rule Editor


General Fields


Installation

Install the package via composer:

Publish and run the migrations:

Publish the config file with:

The CustomForm plugin needs Icon Picker Plugin You can publish the config file with:

Optionally, you can publish the views using

Usage

1. Register the Plugin

Add the plugin to your PanelProvider:


2. Overview

A CustomForm is composed of two main parts:


3. CustomFormConfiguration

Define multiple form configurations to serve different purposes.
For example:

To define a new form, extend the CustomFormConfiguration class:

Key methods:


After creating a new configuration, register it in the ffhs_custom_forms config file:

Notes:

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:

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

Other functions to overwrite

Method Signature Description
formFieldTypes(): array Returns the available custom field types that can be used in the form editor.
- Source: CustomFieldType::getSelectableFieldTypes()
- Purpose: Determines which field types are selectable when building or editing forms.
getRuleTriggerTypes(): array Returns the list of trigger types used in form rule definitions.
- Source: config('ffhs_custom_forms.rule.trigger')
- Example values: on_change, on_submit, etc.
getRuleEventTypes(): array Returns the list of event types that define what happens when a rule is triggered.
- Source: config('ffhs_custom_forms.rule.event')
- Example values: show_field, hide_field, set_value, etc.
editorFieldAdder(): array Returns the available field adders used in the form editor interface.
- Source: config('ffhs_custom_forms.editor.field_adders')
- Purpose: Defines which buttons or UI elements are available for adding fields in the editor.
overwriteViewModes(): array Returns an array of custom view modes that override the default ones.
- Default: An empty array, meaning no overrides by default.
- Use case: Can be extended by child classes to customize how the form is rendered.
abstract public static function identifier(): string An abstract method that must be implemented by each concrete FormType class.
- Purpose: Returns a unique identifier string for the FormType (e.g. "application", "registration").
displayViewMode(): string Returns the view mode to use when displaying the form.
- Default: Uses defaultViewMode().
displayEditMode(): string Returns the edit mode to use when modifying the form.
- Default: Uses defaultViewMode().
displayCreateMode(): string Returns the create mode to use when creating a new instance of the form.
- Default: Uses defaultViewMode().
defaultViewMode(): string Returns the default mode name, which is "default" unless overridden.

CustomFields

A CustomField consists of:

Predefined Field Types

πŸ“₯ Input Fields

πŸ”˜ Choice Fields

✨ Special Fields

πŸ“ Layout Components

Create your own CustomFieldType

Create your own reusable field type by implementing a CustomFieldType and a matching ViewComponent.

  1. Define the Field Type Class

  2. Register Type in Config

  3. Define the FieldTypeView

Other Functions

These optional methods can be overridden in your custom CustomFieldType class to control behavior during field editing, rendering, saving, and cloning.

Method Signature Description
canBeDeactivate(): bool Returns true if this field type can be deactivated (Hidden), otherwise false.
generalTypeOptions(): array Returns a list of general type options for this field type.
extraTypeOptions(): array Returns additional, type options specific to this field type.
beforeSaveField(CustomField $field, array $data): void Called before a field is saved. Use it to preprocess or validate field data before it’s persisted.
afterSaveField(CustomField $field, array $data): void Called after the field has been saved. Use it to trigger post-save logic such as logging or syncing related data.
afterCreateField(CustomField $field, array $data): void Called after a new field is created. Useful for generating default options or setting up linked records.
afterDeleteField(CustomField $field): void Called after a field has been deleted. Can be used to clean up orphaned records or perform audits.
mutateOnCloneField(array $data, CustomField $original): array Allows you to modify data when a field is cloned (on dissolve template). Example: Reset values or generate unique identifiers.
isFullSizeField(): bool Returns true if the field should take the full width of the form layout. Useful for large inputs like TextArea or FileUpload. Default: false.
getEditorFieldBadge(array $rawData): ?string Returns an optional badge label shown in the field editor. Return null for no badge. Used to identify general fields and templates.
getEditorFieldTitle(array $rawData, CustomForm $form): string Returns the title shown for the field in the form editor. Useful for showing the question label, field name, or summary.
fieldEditorExtraComponent(array $rawData): ?string Returns a reference to a custom editor UI component (e.g. Vue or Blade). Rendered in the field's editor panel. Return null to disable.
getEditorActions(string $key, array $rawData): array Returns a list of editor actions (buttons, dropdowns) for the field editor.
Example: Returns delete, edit, and activation actions, with visibility depending on canBeDeactivate().

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. AlpineMaskOption.php
  3. BooleanOption.php
  4. ColumnsOption.php
  5. ColumnSpanOption.php
  6. DateFormatOption.php
  7. HelperTextTypeOption.php
  8. IconOption.php
  9. ImaginaryTypeOption.php
  10. InLineLabelOption.php
  11. InlineOption.php
  12. MaxAmountOption.php
  13. MaxLengthOption.php
  14. MaxSelectOption.php
  15. MaxValueOption.php
  16. MinAmountOption.php
  17. MinLengthOption.php
  18. MinSelectOption.php
  19. MinValueOption.php
  20. NewLineOption.php
  21. RelatedFieldOption.php
  22. ReorderableTypeOption.php
  23. RequiredOption.php
  24. ShowAsFieldsetOption.php
  25. ShowInViewOption.php
  26. ShowLabelOption.php
  27. ValidationAttributeOption.php
  28. ValidationMessageOption.php

Using TypeOptions in a CustomFieldType

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

Creating a custom TypeOption

To create your own option, extend the TypeOption class:

Other optional functions

Method Purpose
mutateOnFieldSave() Modify data before it's saved to the field
mutateOnFieldLoad() Modify data when it's loaded
beforeSaveField() Hook before the field is saved (via reference)
afterSaveField() Hook after the field is saved (via reference)
afterCreateField() Triggered right after the field is created
beforeDeleteField() Hook before the field is deleted
afterDeleteField() Hook after the field is deleted
mutateOnFieldClone() Modify option data when cloning the field
canBeOverwrittenByNonField() Whether this option can be overwritten globally or externally (default: true)

Use FastTypeOption

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

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?


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

Predefined Triggers

Create own Trigger

  1. Create an MyTrigger class

  2. Add your trigger class in the config file:

Create own Event

  1. Create an MyEvent class

  2. Add your event class in the config file:

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.

Editor

Embed the form editor in your layout using CustomFormEditor:

Form Answer Edit

Embed a form for editing its answer using EmbeddedCustomForm. Basic usage:

With automatic saving:

Split layout by section type:

Split layout by specific fields:

Split layout by pose (e.g. question number range):

View answer on an infolist

Embed a view for its answer using EmbeddedCustomForm.

Basic usage:

Split layout by section type:

Split layout by specific fields:

Split layout by pose (e.g. question number range):


Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

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.


All versions of filament-package_ffhs_custom_forms with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^3.0
filament/notifications Version ^3.0
laravel/framework Version ^11.31
laravel/prompts Version ^0.3.1
spatie/laravel-activitylog Version ^4.7
spatie/laravel-permission Version ^6.4
davidhsianturi/blade-bootstrap-icons Version ^1.4
codeat3/blade-carbon-icons Version ^2.18.2
guava/filament-icon-picker Version ^2.0
filament/spatie-laravel-translatable-plugin Version ^3.2
coolsam/flatpickr Version ^4.0
secondnetwork/blade-tabler-icons Version ^3.26
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ffhs/filament-package_ffhs_custom_forms contains the following files

Loading the files please wait ....