Vuejs and Laravel Post Request CORS
<p>I dont get it. I am struggling with this since hours </p>

<p>I am using Vue.js with Laravel and try to make a POST Request to an external API.</p>

<p>But i am always getting a CORS error on my Vue POST Request</p>

<pre><code>methods: {
            chargeCustomer(){
                this.$http.post('/api/chargeCustomer', this.payment).then(function (response) {
                    console.log(response.data)
                },function (response) {
                    console.log(response.data)
                });
            }
        }
</code></pre>

<p><strong>ERROR</strong></p>

<blockquote>
  <p>MLHttpRequest cannot load
  <a href="https://www.mollie.com/payscreen/select-method/JucpqJQses" rel="noreferrer">https://www.mollie.com/payscreen/select-method/JucpqJQses</a>. No
  'Access-Control-Allow-Origin' header is present on the requested
  resource. Origin '<a href="https://payment.dev" rel="noreferrer">https://payment.dev</a>' is therefore not allowed
  access.</p>
</blockquote>

<p>I installed the <a href="https://github.com/barryvdh/laravel-cors" rel="noreferrer">Laravel CORS Package</a> for my Backend and added the middleware to my route e.g</p>

<pre><code>Route::group(['middleware' =&gt; 'cors'], function(){
    Route::post('/api/chargeCustomer', 'Backend\PaymentController@chargeCustomer');
});
</code></pre>

<p>But i am still getting the error. I also tried to add the Vue Headers with</p>

<pre><code>Vue.http.headers.common['Access-Control-Allow-Origin'] = '*';
Vue.http.headers.common['Access-Control-Request-Method'] = '*';
</code></pre>

<p>With the same result/error.</p>

<p>Could someone tell me what i am doing wrong?</p>