Skip to content

hasMany form validation not working on single submit click #5816

@Sivan4562

Description

@Sivan4562
  • Laravel Version: ^10.10
  • PHP Version: 8.1
  • Laravel-admin: ^1.8

Description:

Hi Team,
I am using the hasMany form and I use the ->rules('required') for the form required field when I click the submit button the first time the validation error does not throw the error message when I click the second time it shows the error. Do you know how I can fix this? I attached my code as below.

This is form data

$form->hasMany('customer_experience','Experience Info',function (Form\NestedForm $form) {
   $form->text('title', 'Title')->rules('required');
   $form->text('company', 'Company')->rules('required');
   $form->text('location', 'Location')->rules('required');
   $form->date('start_date', 'Start Date')->rules('required');
   $form->date('end_date', 'End Date')->rules('required');
});

And model

public function customer_experience(){
       return $this->hasMany(CustomerExperience::class, 'customer_id');
}

Can anyone help me to fix this bug?

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