Skip to content

Error getCopyableState(): Return value must be of type ?string, array returned with array cast #22

@AKurka

Description

@AKurka

Problem description
I’m using the PrettyJsonField to display a column that is cast as an array.
However, I get the following error:

Novadaemon\FilamentPrettyJson\Form\PrettyJsonField::getCopyableState(): Return value must be of type ?string, array returned

According to the documentation, using an array cast should not be a problem, but in my case, it triggers this error.


My code

Model:

protected function casts(): array
{
    return [
        'serp' => 'array',
    ];
}

Filament Form:

PrettyJsonField::make('serp')
    ->label('SERP')
    ->columnSpanFull()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions