Skip to content
Discussion options

You must be logged in to vote

To add custom validation for the required pivot select field in your Backpack relationship field, you need to modify your ProductRequest class. Based on the information from the knowledge sources, here's how you can achieve this:

  1. In your ProductRequest class, add the validation rule in the rules() method:
public function rules()
{
    return [
        'articles.*.articles' => 'required',
        // other rules...
    ];
}
  1. Add the custom validation message in the messages() method:
public function messages()
{
    return [
        'articles.*.articles.required' => 'Please select an article or remove the empty block.',
        // other messages...
    ];
}

The key articles.*.articles ta…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ceeckhout
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants