title: The POST method is not supported for this route. Supported methods: GET, HEAD.",…
body: <p>I am having issues while using laravel resourceApi controller along with vue js i am creating and application where i am using vue and laravel i am posting a value to store method of my controller but it is saying the method is not allowded or 405 exception in the response. i need some help i am new to laravel and vue. </p>
  
  <p>Here is my code </p>
  
  <pre><code>**UserController :** 
  
  public function store(Request $request)
      {
          return ['message' =&gt; 'i have your data'];
      }
  
  **Route:**
  Route::apiResources(['user' =&gt; 'API\UserController']);
  
  **Vue Code:**
  
  &lt;form @submit.prevent="createUser"&gt;
              &lt;div class="modal-body"&gt;
                &lt;div class="form-group"&gt;
                  &lt;input
                    v-model="form.name"
                    placeholder="Enter name"
                    type="text"
                    name="username"
                    class="form-control"
                    :class="{ 'is-invalid': form.errors.has('name') }"
                  &gt;
                  &lt;has-error :form="form" field="name"&gt;&lt;/has-error&gt;
                &lt;/div&gt;
  
                &lt;div class="form-group"&gt;
                  &lt;input
                    v-model="form.email"
                    placeholder="Enter email"
                    type="email"
                    name="username"
                    class="form-control"
                    :class="{ 'is-invalid': form.errors.has('email') }"
                  &gt;
                  &lt;has-error :form="form" field="email"&gt;&lt;/has-error&gt;
                &lt;/div&gt;
  
                &lt;div class="form-group"&gt;
                  &lt;textarea
                    v-model="form.bio"
                    placeholder="Enter bio"
                    type="email"
                    name="username"
                    class="form-control"
                    :class="{ 'is-invalid': form.errors.has('bio') }"
                  /&gt;
                  &lt;has-error :form="form" field="bio"&gt;&lt;/has-error&gt;
                &lt;/div&gt;
  
                &lt;div class="form-group"&gt;
                  &lt;select
                    v-model="form.type"
                    placeholder="Enter bio"
                    name="type"
                    class="form-control"
                    :class="{ 'is-invalid': form.errors.has('type') }"
                  &gt;
                    &lt;option value&gt;---Select User Role---&lt;/option&gt;
                    &lt;option value="admin"&gt;Admin&lt;/option&gt;
                    &lt;option value="user"&gt;Standard User&lt;/option&gt;
                    &lt;option value="author"&gt;Author&lt;/option&gt;
                  &lt;/select&gt;
                  &lt;has-error :form="form" field="bio"&gt;&lt;/has-error&gt;
                &lt;/div&gt;
  
                &lt;div class="form-group"&gt;
                  &lt;input
                    v-model="form.password"
                    placeholder="Enter email"
                    type="password"
                    name="password"
                    class="form-control"
                    :class="{ 'is-invalid': form.errors.has('password') }"
                  &gt;
                  &lt;has-error :form="form" field="password"&gt;&lt;/has-error&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                &lt;button type="button" class="btn btn-danger" data-dismiss="modal"&gt;Close&lt;/button&gt;
                &lt;button type="submit" class="btn btn-primary"&gt;Create&lt;/button&gt;
              &lt;/div&gt;
            &lt;/form&gt;
  
  **Vue method :**
  
    createUser() {
        this.form.post("api/user");
      }
  </code></pre>
  
  <p><strong>error:</strong>
  <a href="https://i.stack.imgur.com/Z9NBz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z9NBz.png" alt="enter image description here"></a> </p>