Z3d0X / filament-fabricator

Block-Based Page Builder Skeleton for your Filament Apps
https://filamentphp.com/plugins/fabricator
MIT License
269 stars 52 forks source link

Infinite loop when Builder in used inside Builder #159

Closed enact-on closed 3 months ago

enact-on commented 4 months ago

Hello, I've been playing around with this awesome package and it does a wonderful job. I are trying to use this to act like a "Page builder" for simple frontend website.

I want to create column options for the page block, and tried this simple approach, basically to provide PageBuilder itself in the schema. However it goes to infinite loop and throws this error.

Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '512' frames

Anyway to get this issue resolved ? Or maybe another approach to manage the column option.

Here's the code

public static function getBlockSchema(): Block
{
    return Block::make('two-column')
        ->columns(2)
        ->schema([
            PageBuilder::make('block1')->label(__('filament-fabricator::page-resource.labels.blocks')),
            PageBuilder::make('block2')->label(__('filament-fabricator::page-resource.labels.blocks')),
        ]);
}
Z3d0X commented 4 months ago

You'd need to manually define the blocks for the nested page builder.

See for an example https://github.com/Z3d0X/filament-fabricator/discussions/36#discussioncomment-4847370