March 15, 2016
If you have a site with public-facing URLs and are concerned at all about SEO (which you probably should be) then you'll want to do your best to give search engine crawlers as much information about the pages on your site as possible.
Suppose in your Laravel app you have a model called "NewsItem" and NewsItems are accessed via a URL like
http://myapp.com/news-items/123, where 123 is the ID of a specific NewsItem.
A more descriptive URL may include a human readable name of the NewsItem. This helps both users and search engines gather more information about a particular NewsItem, and is said to help improve search rankings for this page and your site.
What follows is a very basic technique to add a more descriptive URL for your models. Instead of just having an ID for each model instance in your URL, you would have something more descriptive, such as