title: How do I make asset() work correctly in Laravel 8.x?
body: <p>I am using Laravel 8.x in Windows 10 along with Vue 2.6.12. I am working my way through a video on combining Vue with Laravel. The video is for an older version of Laravel, probably 5.5, and probably a slightly older Vue as well so that may well be the nature of my problem. Here's the link to the <a href="https://www.youtube.com/watch?v=DJ6PD_jBtU0&amp;t=238s" rel="nofollow noreferrer">video</a>. I'm at about the 8:00 minute mark.</p>
  <p>The problem I'm having is that when I try to execute my code, Laravel isn't seeing the app.js file no matter how much I experiment with the src parameter of the script tag. (I have a good imagination and I've done a LOT of experimenting.) The Laravel manual has not been of much help here except that I saw it mentioned an ASSET_URL parameter for the .env file so I tried specifying the leading part of the path there but <em>nothing</em> I've tried works; I inevitably get a 404 error. (For what it's worth, I've tried removing asset() and just coding a path the traditional way but that doesn't work either.)</p>
  <p>My app.js file is at /resources/assets/js/app.js. The file that contains the script tag, layout.blade.php, is at /resources/views/layout.blade.php. The code in the script tag says:</p>
  <pre><code>&lt;script src=&quot; asset('js/app.js')&quot;&gt;&lt;/script&gt; 
  </code></pre>
  <p>just like the video. In the .env file, ASSET_URL='/resources/assets/'. What do I need to change to make this work? I can't think of anything else to try!</p>