New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

thiktak/filament-nested-builder-form

Plugin for FilamentPHP - Nested Builder Form Component
9,733 20

Larablocks Analysis

thiktak/filament-nested-builder-form works with Laravel 10 (latest release v1.0.1, Sep 14, 2023), which reached end of life on Feb 4, 2025: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 10, past end of life since Feb 4, 2025
  • No release in the last 12 months (last: Sep 14, 2023)
  • 126 downloads a month (needs 10,000)
  • 20 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Sep 14, 2023.
  • No releases in the last 12 months.
  • First released: Sep 10, 2023.
  • Monthly downloads: 126, about the same as six months ago.
  • 8 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.

Install
composer require thiktak/filament-nested-builder-form
Latest Version:v1.0.1
PHP:^8.1
Laravel:10
License:MIT
Last Updated:Jul 8, 2024
Links: GitHub  ·  Packagist
Maintainer: Thiktak
Preview

Nested Builder Form (Filament v3 Form)

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Filament V3 Form plugin. Add a new feature for Nested Builder.

Installation

You can install the package via composer:

composer require thiktak/filament-nested-builder-form

Usage

On any Form :

  1. Call NestedBuilder instead of Builder
  2. All all your Builder configuration inside nestedConfiguration(Closure).
  3. Use nestedSchema(Closure) instad of schema(Closure | array)

Use $builder->getLevel() of NestedSubBuilder to know where you are (level 1 to n)

Note:

  • NestedBuilder like Builder works with an array/json data.

use Thiktak\FilamentNestedBuilderForm\Forms\Components\NestedBuilder;
use Thiktak\FilamentNestedBuilderForm\Forms\Components\NestedSubBuilder;
// ...

        NestedBuilder::make('array_configuration')
            // Add configuration to Builder & sub-builder
            ->nestedConfiguration(function (NestedSubBuilder $builder) {
                // Apply only for the root level
                $builder->blockNumbers($builder->getLevel() == 1);

                // Apply for all others levels
                $builder->columnSpanFull(); // full width
            })

            // Replace schema() by nestedSchema
            ->nestedSchema(function (NestedSubBuilder $builder) { // Closure is mandatory
                return [
                    Block::make('group')
                        ->schema([
                            Select::make('title')
                                ->required(),

                            // Call builder importer and call it children
                            $builder->importNestedBlocks('children'),
                        ]),

                    Block::make('rule')
                        ->schema([
                            TextInput::make('field')
                                ->required(),
                        ])
                ];
            });

image

Example

One concrete example of this package, allow you to create a nested AND/OR field/condition/value like complexe group SQL queries.

use Thiktak\FilamentNestedBuilderForm\Forms\Components\NestedBuilder;
use Thiktak\FilamentNestedBuilderForm\Forms\Components\NestedSubBuilder;
// ...

        NestedBuilder::make('array_configuration')
            ->nestedConfiguration(function (NestedSubBuilder $builder) {
                $builder->blockNumbers($builder->getLevel() == 1);
                $builder->columnSpanFull(); // full width
            })
            ->nestedSchema(function (NestedSubBuilder $builder) {
                return [
                    Block::make('group')
                        ->label(sprintf('Group (%s)', $builder->getLevel()))
                        ->schema([
                            Select::make('condition')
                                ->options(['and' => 'AND', 'or' => 'OR'])
                                ->default('and')
                                ->required(),

                            $builder->importNestedBlocks('children'),
                        ])
                        ->columns(1),

                    Block::make('rule')
                        ->label(sprintf('Rule (%s)', $builder->getLevel()))
                        ->schema([
                            TextInput::make('field')
                                ->required()
                                ->columnSpan(2),

                            Select::make('sign')
                                ->options(['=', '<>', '>', '<', 'in(,)'])
                                ->default('=')
                                ->required(),

                            TextInput::make('value')
                                ->columnSpan(3),
                        ])
                        ->columns(6)
                ];
            });

image

Example of advanced usage of this package:

image

How it work ?

You can achieve the same behavior with few lines of code.

  1. Create a function with your builder ($nested = fn($builder) => [...];)
  2. On your schema, pass the function that call itself inside a lambda function (fn() => $nested($nested)).
  3. On you builder function, add a new Builder with identical logic (Builder::make()->schema(fn() => $builder($builder)))

Example:

use Thiktak\FilamentNestedBuilderForm\Forms\Components\NestedBuilder;
use Thiktak\FilamentNestedBuilderForm\Forms\Components\NestedSubBuilder;
// ...

    public static function form(Form $form): Form
    {
        $nested = function ($builder) {
            return [
                Block::make('group')
                    ->schema([
                        Select::make('condition')
                            ->options(['and' => 'AND', 'or' => 'OR'])
                            ->default('and')
                            ->required(),

                        \Filament\Forms\Components\Builder::make('children')
                            ->schema(fn () => $builder($builder))
                    ])
                    ->columns(1),

                Block::make('rule')
                    ->schema([
                        TextInput::make('field')
                            ->required()
                            ->columnSpan(2),

                        Select::make('sign')
                            ->options(['=', '<>', '>', '<', 'in(,)'])
                            ->default('=')
                            ->required(),

                        TextInput::make('value')
                            ->columnSpan(3),
                    ])
                    ->columns(6)
            ];
        };

        
        return $form
            ->schema([
                \Filament\Forms\Components\Builder::make('array_configuration')
                    ->schema(fn () => $nested($nested))
            ]);
    }

Use thiktak/filament-nested-builder-form if you want to implement a rich SQL selector & query builder.

Testing

composer test

Changelog

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

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.

Related Packages

thiktak/filament-simple-list-entry

Simple List Entry for Infolist

7,584 22
fadlee/filament-qrcode-field

QR code scanner for Filament

381 4
inerba/filament-db-config

A Filament plugin for database-backed application settings and editable content,...

26,138 38
filagora/filagora-core

Filagora core: module registry, settings and shared support for the Filagora Fil...

2,366 0
filagora/filagora-entitlements

Entitlements for Filagora: definitions, grants, requests, a cached resolver and...

1,658 0

Version History

Version Released PHP Laravel License
v1.0.1 ^8.1 ^10.0 MIT
v1.0.0 ^8.1 ^10.0 MIT