Dwight Watson's blog

Serving site.webmanifest on Laravel Vapor

August 18, 2021

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;
developer of Roomies.com, myRent.co.nz, High School Notes & StudentVIP.com.au.

Follow me on Twitter, or GitHub.