slug
How to Add Slug as Default Route Key in Laravel
· ☕ 2 min read · ✍️ shibu
Earlier one of my laravel project used id as route key name. I have found, slug is more readable/memorable. So instead of using id I started to use slug as route key name. laravel-sluggable While create a post, we can generate a slug by our own. To do this we can use Str::slug method and append some unique value to make it unique.