1 year ago

Dynamic fields should not have same value

Posted 1 year ago by dimdot


I'm implementing a form with dynamic fields being added by an add field button. What I need is to prevent some of these fields to have the same value before submission.

Currently my Request rules look like this:

public function rules()
    return [
        'myfield.*.domain' => 'required|url',
        'myfield.*.group' => 'required',
        'myfield.*.client' => 'nullable'

For instance, what if want the domain input to be unique in the form submission (not the database)? Is this possible?

Any help would be really appreciated!


Please sign in or create an account to participate in this conversation.