mardi 11 août 2020

Getting dynamic field data using vue.js in laravel

I am creating multiple dynamic fields and the same is posted to the laravel controller methods but i'm able to get the simple fields data (fields that are not dynamically generated) but the array fields that are dynamically generated those values i'm unable to get in the controller method.

 <input :name="'students['+studentdetails.id+']['+studentdetails.class+']'" type="text" class="form-control"/>
 <input :name="'students['+studentdetails.id+']['+studentdetails.class+']'" type="text" class="form-control"/>

In my controller method when i'm getting it:

  printr($request->attributes);


 export default {
  data() {
...

return {
      
      form: new Form({
        title: "",
        attributes: [],
        }),
   };

  addStudent() {
          const header = {
            Authorization: "Bearer " + this.token,
          };
          this.form
            .post(APP_URL + `/api/addStudent`, { headers: header })
            .then((response) => {
              if (response.status == 200) {
                location.replace(APP_URL + "/success");
              } 
            });
        },
};

there is not value.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/30MoPWE
via IFTTT

Aucun commentaire:

Enregistrer un commentaire