title: CORS issue in react app, can't upload images
body: <p>I'm using laravel for api and react js for front-end thing. But whenever I'm trying to upload images to the server, I'm getting CORS issue.</p>
  <pre><code>'api-url has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.'
  </code></pre>
  <p>sometimes it works but sometimes not. Is there any permanent solution?</p>
  <p>I'm using following plugin for cors.
  <a href="https://github.com/fruitcake/laravel-cors" rel="nofollow noreferrer">https://github.com/fruitcake/laravel-cors</a></p>
  <p>cors.php</p>
  <pre><code>return[
      'paths' =&gt; ['api/*'],
      'allowed_methods' =&gt; ['*'],
      'allowed_origins' =&gt; ['*'],
      'allowed_origins_patterns' =&gt; [],
      'allowed_headers' =&gt; ['*'],
      'exposed_headers' =&gt; [],
      'max_age' =&gt; 0,
      'supports_credentials' =&gt; false,]
  </code></pre>