Could we help you? Please click the banners. We are young and desperately need the money
Are you on Windows, running Laravel on Docker through Sail and are experiencing long page loads or bad performance in general? If you've installed Laravel to your Windows file system (NTFS) rather than directly to the WSL 2 file system, that's the probable cause.
The fix is quite easy, just install or move your Laravel project into the WSL file system. You can navigate there by entering the path "\\wsl$" into the address bar of the Windows Explorer. There, you'll find your installed Linux distributions. A decent place to put your project is in your distribution's "/home" directory. You should also install PHP, Composer, npm/bun, etc. on WSL to directly run them from within the virtual machine.
Use the following command to install PHP, Composer, and the Laravel Installer on WSL (credit: php.new):
/bin/bash -c "$(curl -fsSL https://php.new/install/linux)"
Use the following command to install bun on WSL (credit: bun.sh):
curl -fsSL https://bun.sh/install | bash
If you're using GitHub Desktop for managing your repository or VSCode to edit it, they may prompt you for permission before connecting to the WSL file system, which you should allow.