title: PUT request won't get ID of the record in Vue.js with Laravel
body: <p>I'm trying to make a CRUD project using Vue.js in Laravel, and I'm successfully in the last step, editing. But I'm stuck in it. <br>
  I'm trying to use the same form to edit that I've use for creating also. One form, two tasks.<br> The only error I get is <strong>PUT http://localhost:8000/api/student/undefined 404 (Not Found)</strong>, yeah I can't pass the ID (or model?) to Axios.</p>
  <p>I think my routes, controllers in Laravel side are alright, but I can't pass the current ID of the edited record to Axios. Also, I don't have any ID input on the form. That might be the cause.</p>
  <p><strong>My Vue code to edit</strong></p>
  <pre><code>addStudent(student, id) {
                  if(this.edit === false){
                      axios.post(`api/students/create`, {
                      first_name:this.first_name,
                      last_name:this.last_name,
                      student_number:this.student_number,
                      phone_number:this.phone_number,
                      email:this.email,
                      birth_date:this.birth_date,
                      school_name:this.school_name,
                      });
                  } else {
                      axios.put(`api/student/`+this.id, {
                          first_name:this.first_name,
                          last_name:this.last_name,
                          student_number:this.student_number,
                          phone_number:this.phone_number,
                          email:this.email,
                          birth_date:this.birth_date,
                          school_name:this.school_name,
                      });
                  }
              },
  </code></pre>
  <p><strong>My route (in api.php)</strong></p>
  <pre><code>Route::put('student/{id}', 'StudentController@update');
  </code></pre>
  <p><strong>My Controller</strong></p>
  <pre><code>public function update(Request $request, $id)
      {
          $student = Student::findOrFail($id);
  
          $student-&gt;first_name = $request-&gt;get('first_name');
          $student-&gt;last_name = $request-&gt;get('last_name');
          $student-&gt;student_number = $request-&gt;get('student_number');
          $student-&gt;phone_number = $request-&gt;get('phone_number');
          $student-&gt;first_name = $request-&gt;get('email');
          $student-&gt;email = $request-&gt;get('first_name');
          $student-&gt;birth_date = $request-&gt;get('birth_date');
          $student-&gt;school_name = $request-&gt;get('school_name');
  
          $student-&gt;save;
  
          return redirect('/');
  </code></pre>
  <p><strong>Form action</strong></p>
  <pre><code>&lt;form @submit.prevent=&quot;addStudent()&quot;&gt;
  </code></pre>
  <p>I need to finish this, I need any help that I can get. Thank you</p>