title: How to access API route from laravel with token on a docker setup?
body: <p>So, I've done exactly how laravel docs instructs to install on docker using sail, nice and easy. Everything works fine, database and all. My problem is that I've setup a simple api route that I want to acces using a token generated with sanctum. Everything works ok using postman, or even calling the api route from another instance of laravel in other container in docker using guzzle (http in laravel) but not with http://localhost with the local ip ..but when I'm trying to call the api route from the same laravel app is not working..even with the ip, it just hangs with loading.</p>
  <p>Also I'm running docker with wsl2 on windows 10.</p>
  <p>I guess it has something to do with a network setting from docker.. but I tried so many things and nothing worked.. plus I need to sail down and sail up every time cuz it gets stuck and is not working anymore.</p>
  <p>This is how I call the route:</p>
  <pre><code>Http::withToken('token')-&gt;get('http://localhost/api/user');
  </code></pre>
  <p>Pls.. help!
  Thank you :)</p>