Created
December 4, 2021 08:20
-
-
Save adinata-id/26162c656ef72cb7cf8b6927e18a06af to your computer and use it in GitHub Desktop.
Return Sitemap XML File Using Laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Route::get('/sitemap.xml', function () { | |
$content = Storage::disk('digitalocean')->url('sitemap.xml'); | |
return response(file_get_contents($content), 200, [ | |
'Content-Type' => 'application/xml' | |
]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to show this output xml
open browser and enter
https://yourdomain/sitemap.xml