nova-flexible-content icon indicating copy to clipboard operation
nova-flexible-content copied to clipboard

BelongsTo relationship issue

Open msucevan opened this issue 2 years ago • 2 comments

Basically, when I'm using BelongsTo field outside the addLayout is working good.

But when I'm trying to use a Flexible field and I'm trying to use BelongsTo inside addLayout method this is not working.

            Flexible::make(__('Parameter'), 'parameter')
                ->addLayout(__('Parameter'), 'parameter', [
                    BelongsTo::make(__('Param'), 'param', Param::class)
                        ->sortable()
                        ->rules('required'),
                ])
                ->button(__('Add Parameter'))

msucevan avatar Nov 10 '23 09:11 msucevan

As a workaround, you can use a Select field with pluck() to list all your relations, but this would be nice to have regardless.

Senexis avatar Nov 13 '23 09:11 Senexis

Thank you for the reply. I was just wondering if was supported or not, I will use the workaround that you mentioned

msucevan avatar Nov 14 '23 10:11 msucevan