I have a sitemap.xml file in my view folder and this is the route:
Route::get('sitemap.xml',function() {
return response()->view('sitemap')
->header('Content-Type', 'xml');
});
But when i search mydomainname.com/sitemap.xml. It returns InvalidArgumentException View [sitemap] not found.
I tried to search on google and youtube but not able to find any solution.
Just move your sitemap.xml to public directory. It doesn't need any Route.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With