blendbyte / nova-items-field

Laravel Nova array items field with sorting & validation
MIT License
13 stars 9 forks source link

Broken on Actions #10

Closed sit-fricke closed 1 year ago

sit-fricke commented 1 year ago

When using the field on Actions it will not render any controls, only the label. This is because the resolve method is not called when the field is used within an action.

For my use case I found a workaround:

        return Items::make(
            __('apiKey.field.ip_constraints'),
            'ip_constraints'
        )
            ->withMeta([
                'max' => false,
                'listFirst' => false,
            ])
            ->rules([
                'ip_constraints.*' => ['ip'],
            ]);

This also applies to all other default values like createButtonValue for example.

bashgeek commented 1 year ago

Thanks for reporting! This should be fixed now and be in the next release.