title: Undefined variable in laravel with vue using vform package
body: <p>I dont know whats happening with my code in the controller. I just want to send an email based on the select option from my vue component. It just says <code>undefined variable request</code>. Im using vform package from vue. But in my controller I already defined the request variable with with the id of the select option from my vue component. But when I put some static email, it can send email and it worked. Can someone know what is the solution? Thanks.</p>
  
  <p>Error in preview in network tab</p>
  
  <pre><code>{message: "Undefined variable: request", exception: "ErrorException",…}
  exception: "ErrorException"
  file: "C:\Users\bustillo-ronald\Desktop\Laravel-SPA\app\Http\Controllers\API\UserController.php"
  line: 196
  message: "Undefined variable: request"
  trace: [,…]
  </code></pre>
  
  <p>My controller</p>
  
  <pre><code>    public function sendEmail(Request $request){
  
          $beautymail = app()-&gt;make(\Snowfire\Beautymail\Beautymail::class);
          $beautymail-&gt;send('emails.welcome', [], function($message)
           {
              $message
                  -&gt;from('test@gmail.com')
                  //-&gt;to('sampleemail@gmail.com')//this is working with static data
                  -&gt;to($request-&gt;email)
                  -&gt;subject('Welcome!');
          });
      }
  </code></pre>
  
  <p>My vue component with vform</p>
  
  <pre><code>           &lt;form @submit.prevent="sendEmail()"&gt;
                      &lt;div class="modal-body"&gt;
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;Users Lsit&lt;/label&gt;
                              &lt;select v-model="form.email" name="email" id="email" class="form-control" :class="{ 'is-invalid': form.errors.has('email') }"&gt;
                                  &lt;option  v-for="user in users.data" :key="user.id" &gt;{{user.email}}&lt;/option&gt;
                              &lt;/select&gt;
                              &lt;has-error :form="form" field="type"&gt;&lt;/has-error&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;Message&lt;/label&gt;
                              &lt;textarea v-model="form.message" name="message" placeholder="Message" class="form-control" :class="{ 'is-invalid': form.errors.has('message') }"&gt;&lt;/textarea&gt;
                              &lt;has-error :form="form" field="message"&gt;&lt;/has-error&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;div class="modal-footer"&gt;
                          &lt;button type="button" class="btn btn-secondary" data-dismiss="modal"&gt;Close&lt;/button&gt;
                          &lt;button type="submit" class="btn btn-primary"&gt;Send Email&lt;/button&gt;
                      &lt;/div&gt;
                         &lt;/form&gt;
  </code></pre>
  
  <p>The script.</p>
  
  <pre><code>export default {
          data() {
                  return {
                      form: new Form({
                          id:'',
                          email: '',
                          message: ''
                      }),
                      users: []
                  }
              },
              methods: {
                  getUsers() {
                      axios.get('api/user')
                          .then((res) =&gt; {
                              this.users = res.data
                          })
                  },
                  sendEmail(){
                      this.form.post('api/sendemail')
                            .then(()=&gt;{
                                 $('#exampleModal').modal('hide');
                                 $(".modal-backdrop").remove();
  
                                 swal.fire("Email sent!", "", "success");
  
                            })
                            .catch((e)=&gt;{
                                console.log(e)
                            })
                  }
              },
              created() {
                  this.getUsers();
                  console.log('Component mounted.')
              }
      }
  </code></pre>
  
  <p>Vue devtools 
  <a href="https://i.stack.imgur.com/AUPS2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AUPS2.png" alt="enter image description here"></a></p>