title: React Fetch API in Laravel application
body: <p>I've seen this not-so-perfect solution where we're supposed to place a universal view route and then route everything from react-router like so:</p>
  <pre><code>Route::view('/{any}', 'layouts.app')-&gt;where('any', '.*');
  </code></pre>
  <p>or</p>
  <pre><code>Route::view('/{any?}', 'layouts.app');
  </code></pre>
  <p>But the big issue here is when I'm fetching data to react from within my laravel application, for example: <code>/posts</code>, react-router will try to resolve <code>/posts</code>, but laravel will match it with <code>/{any?}</code>, and <strong>the fetch call will respond with a view</strong>.</p>
  <p>Is there a way to make <code>apiResource</code> calls like described, and if so, how?</p>