Starting from Laravel 11, changing the public directory of Laravel is no longer as complicated. This is something that should have been automatic, or at least well-documented, but it still frustrates hundreds of developers around the world. It helps to avoid error: Unable to locate file in Vite manifest.
On index.php, add the following line after $app declaration:
$app->usePublicPath(__DIR__);
And then configure Vite to generate the assets in the correct directory (vite.config.js):
build: {
outDir: 'public_html/build',
manifest: 'manifest.json',
},
Then npm run build and always good to clean caches.





