Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

murilo's avatar
Level 10

Vue Application + Laravel . Cors error

Hello I have an application that is in VUE , It is a Single Page Application built with VUE and Laravel in Backend . Well , it is in the same server , but my front make the request with a subdomain address , maybe because that it is giving this error .

I have this structures

Front ( VUE ) -> IP - 144.222.222.222 ( an  example )
Backend ( Laravel ) -> app.mywebsite.com ( an example, it is a sub domain )

so , when I make the request in VUE , I make the Request calling the sub domain address backed ( app.mywebsite.com ) .

It is giving this error -

'https://app.mywebsite.com/api/send-email' from origin 'http://144.222.222.222 ' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I tried to make a Cors , middleware , like this -

https://www.youtube.com/watch?v=84bXch-YIvI

But I was not success, it gave the same error .

0 likes
3 replies
murilo's avatar
Level 10

my config/cors is like that -


    'paths' => ['api/*'],

    'allowed_methods' => ['*'],

    'allowed_origins' => ['*'],

    'allowed_origins_patterns' => [],

    'allowed_headers' => ['*'],

    'exposed_headers' => [],

    'max_age' => 0,

    'supports_credentials' => false,

Please or to participate in this conversation.