title: redirect to different page with success message after payment - Vue JS
body: <p>I have a payment modal that opens up, once the user fills it out, and if the payment is successful, I want to redirect to a different page, with a success message. Im using Laravel 5.3 and Vue JS. </p>
  
  <p>Right now, this is how it looks like, and I got it to redirect to a different page, but how would I attach some sort of success message?</p>
  
  <pre><code>this.$http.post('/cropkit/public/subscriptions', this.$data).then(
      window.location.replace('/cropkit/public/profile/dashboard'),
      response =&gt; this.status = response.body.status
  );
  </code></pre>
  
  <p>/******** EDIT *********/</p>
  
  <p>Here is the solution to check if is successful, or error occurred:</p>
  
  <p><a href="http://t4t5.github.io/sweetalert/" rel="nofollow noreferrer">swal</a> is a alert message plugin</p>
  
  <pre><code>                    this.$http.post('/mysite/subscriptions', this.$data).then((response) =&gt; {
                          swal({
                             title: "Success!",
                             text: "Payment has been processed!",
                             type: "success",
                             showConfirmButton: false,
                             allowEscapeKey: false,
                             allowOutsideClick: false,
                             timer: 5000,
                          }),
                          setTimeout(function(){
                              window.location.replace('/mysite/profile/dashboard');
                          }, 4000)
                      }, (response) =&gt; {
                          this.status = response.body.status
                      });
  </code></pre>