Dwight Watson's blog

Serving site.webmanifest on Laravel Vapor

This blog post was originally published a little while ago. Please consider that it may no longer be relevant or even accurate.

For whatever reason Laravel Vapor explictly does not publish your site.webmanifest file, and it won't be ~~fixed~~ changed until the next major version. To get around this in the meantime you can add a route that simply serves the file from the public path (and optionally use the cache middleware).

Route::middleware('cache.headers:public;max_age=2628000;etag')
->get('/site.webmanifest', fn () => file_get_contents(public_path('site.webmanifest')));

A blog about Laravel & Rails by Dwight Watson;

Picture of Dwight Watson

Follow me on Twitter, or GitHub.