Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

can209's avatar

Filament\Forms\Components\Builder::Filament\Forms\Components\{closure}(): Argument #1 ($itemData) must be of type array, string given

Filament\Forms\Components\Builder::Filament\Forms\Components{closure}(): Argument #1 ($itemData) must be of type array, string given

Code:

                Card::make()
                    ->schema([
                        FormsBuilder::make('content')
                            ->label('İçerik')
                            ->blocks([
                                FormsBuilder\Block::make('heading')
                                    ->schema([
                                        TextInput::make('content')
                                            ->label('Heading')
                                            ->required(),
                                        Select::make('level')
                                            ->options([
                                                'h1' => 'Heading 1',
                                                'h2' => 'Heading 2',
                                                'h3' => 'Heading 3',
                                                'h4' => 'Heading 4',
                                                'h5' => 'Heading 5',
                                                'h6' => 'Heading 6',
                                            ])
                                            ->required(),
                                    ]),
                            ])->columnSpan(2),
                    ])->columns(2),

I'm getting this error on the edit page. Can you help me solve it?

0 likes
3 replies
kokoshneta's avatar

Please edit your code to format the code. Unformatted code like this is impossible to read. You can make code blocks by adding three backticks (```) on a separate line before and after the code.

Also, what is FormsBuilder? There’s no such class in Filament, as far as I can tell.

can209's avatar

It was necessary to edit $casts from the model page. Thanks.

    protected $casts = [
        'layout' => 'json',
    ];

Please or to participate in this conversation.