title: retrieving data from input - laravel
body: <p>With my code below, when i submit the form, the name and email field in the database is saved empty. This tells i am not able to retrieve the inputs even though i am using the right <code>name elements</code> for the inputs. </p>
  
  <p>What am i doing wrong here?
   <strong>HTML</strong>      </p>
  
  <pre><code>  &lt;form  action="/" class="fixed-form icons-tab-steps wizard-circle"&gt;
                    &lt;!-- Step 1 --&gt;
                    &lt;h6&gt;&lt;i class="step-icon ft-user"&gt;&lt;/i&gt; Step 1&lt;/h6&gt;
                    &lt;fieldset&gt;
                      &lt;div class="row"&gt;
                        &lt;div class="col-md-6"&gt;
                          &lt;div class="form-group"&gt;
                            &lt;label for="firstName2"&gt;Full Name :&lt;/label&gt;
                            &lt;input type="text" class="form-control square" id="name" value="{{$current_user-&gt;name}}" name="fullname"&gt;
                          &lt;/div&gt;
                        &lt;/div&gt;
                        &lt;div class="col-md-6"&gt;
                          &lt;div class="form-group"&gt;
                            &lt;label for="lastName2"&gt;Email Address :&lt;/label&gt;
                            &lt;input type="text" class="form-control square" value="{{$current_user-&gt;email}}" id="lastName2" name="email"&gt;
                          &lt;/div&gt;
                        &lt;/div&gt;
  
                    &lt;!-- Step 4 --&gt;
                    &lt;h6&gt;&lt;i class="step-icon ft-layout"&gt;&lt;/i&gt;Step 4&lt;/h6&gt;
                    &lt;fieldset&gt;
                    &lt;div class="row"&gt;
                        &lt;div class="col-md-12"&gt;
                          &lt;div class="form-group"&gt;
                            &lt;label for="firstName2"&gt;Your Company :&lt;/label&gt;
                            &lt;input type="text" class="form-control square" id="name" name="company"&gt;
                          &lt;/div&gt;
                        &lt;/div&gt;                      
                      &lt;/div&gt;
  
                        &lt;div class="col-md-6"&gt;
                          &lt;div class="form-group"&gt;
                            &lt;label for="location2"&gt;Location :&lt;/label&gt;
                            &lt;input type="text" class="form-control square" id="name" name="location"&gt;
  
                          &lt;/div&gt;
                        &lt;/div&gt;
  
                    &lt;/fieldset&gt;
                  &lt;/form&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>$(".icons-tab-steps").steps({
      headerTag: "h6",
      bodyTag: "fieldset",
      transitionEffect: "fade",
      titleTemplate: '&lt;span class="step"&gt;#index#&lt;/span&gt; #title#',
      labels: {
          finish: 'Submit'
      },
      onFinished: function (event, currentIndex) {
  
          alert("Forms submitted.");
  
          $.ajax({
              method: 'GET', // Type of response and matches what we said in the route
              url:'/user/update/2',
              success: function(response){ // What to do if we succeed
                  console.log("paased"); 
  
              },
              error: function(jqXHR, textStatus, errorThrown) { // What to do if we fail
                 console.log(JSON.stringify(jqXHR));
                 console.log("AJAX error: " + textStatus + ' : ' + errorThrown);
                 console.log("failed"); 
  
             }
             });
      }
  
  });
  
  
  // Validate steps wizard
  
  // Show form
  var form = $(".steps-validation").show();
  
  $(".steps-validation").steps({
      headerTag: "h6",
      bodyTag: "fieldset",
      transitionEffect: "fade",
      titleTemplate: '&lt;span class="step"&gt;#index#&lt;/span&gt; #title#',
      labels: {
          finish: 'Submit'
      },
      onStepChanging: function (event, currentIndex, newIndex)
      {
          // Allways allow previous action even if the current form is not valid!
          if (currentIndex &gt; newIndex)
          {
              return true;
          }
          // Forbid next action on "Warning" step if the user is to young
          if (newIndex === 3 &amp;&amp; Number($("#age-2").val()) &lt; 18)
          {
              return false;
          }
          // Needed in some cases if the user went back (clean up)
          if (currentIndex &lt; newIndex)
          {
              // To remove error styles
              form.find(".body:eq(" + newIndex + ") label.error").remove();
              form.find(".body:eq(" + newIndex + ") .error").removeClass("error");
          }
          form.validate().settings.ignore = ":disabled,:hidden";
          return form.valid();
      },
      onFinishing: function (event, currentIndex)
      {
          form.validate().settings.ignore = ":disabled";
          return form.valid();
      },
      onFinished: function (event, currentIndex)
      {
          alert("Submitted!");
      }
  });
  
  // Initialize validation
  $(".steps-validation").validate({
      ignore: 'input[type=hidden]', // ignore hidden fields
      errorClass: 'danger',
      successClass: 'success',
      highlight: function(element, errorClass) {
          $(element).removeClass(errorClass);
      },
      unhighlight: function(element, errorClass) {
          $(element).removeClass(errorClass);
      },
      errorPlacement: function(error, element) {
          error.insertAfter(element);
      },
      rules: {
          email: {
              email: true
          }
      }
  });
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>$user = User::whereId($id)-&gt;firstorFail();
          $user-&gt;name = $request-&gt;get('fullname');
          $user-&gt;email = $request-&gt;get('email');
          $user-&gt;save();
  </code></pre>