Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Freek Van der Herten:
Automatically generate a sitemap in Laravel
Sep 01, 2016 @ 15:51:31

Freek Van der Herten has a post to his site sharing a package and showing how to use it to generate a sitemap for your Laravel application automatically.

Today my company released a package called laravel-sitemap. There are already a lot of excellent sitemap packages out there. They all have in common that you have to manually add links that must appear in the sitemap. With our new package that isn’t required. It can automatically build up a sitemap by crawling a site. In this post I’d like to explain why we built it and how it works.

He starts off talking about why a sitemap might even be needed, mostly related to other automatic systems (like search engine spiders) that would use to reach even the far parts of your application. He then gets into the code, showing two examples of generating the XML document: one that's more manual and another using the "generator" to create based off of a base URL. He ends the post talking about some limitations of the package and includes a few links for further reading on the subject of sitemaps.

tagged: sitemap laravel application package example tutorial generate

Link: https://murze.be/2016/08/automatically-generate-a-sitemap-in-laravel/


Trending Topics: