The primary principle behind implementing self-healing URLs is being able to segregate the unique identifier (the ID) from the other components of the URL (the SEO-friendly bits). Let's figure out how to do it in Laravel!
You can read this as a blog post at https://aaronfrancis.com/2023/self-he....
To learn more about nanoids: https://github.com/ai/nanoid.
Follow me:
Twitter: / aarondfrancis
LinkedIn: / aarondfrancis
Website: https://aaronfrancis.com - find articles, podcasts, courses, and more.
Chapters:
00:00 Amazon and Medium
00:53 Setting up route-model binding
01:55 Appending a unique identifier
04:00 Generating the slugged URLs
05:49 Throwing a redirect
09:47 Hiding our primary keys
13:19 No redirect map needed