Eloquent Sluggable
Published on by Eric L. Barnes
A sluggable trait for your Eloquent models:
A slug is a simplified version of a string, typically URL-friendly. The act of “slugging” a string usually involves converting it to one case, and removing any non-URL-friendly characters (spaces, accented letters, ampersands, etc.). The resulting string can then be used as an indentifier for a particular resource.
I feel like slugs are more suited for JavaScript that way the end user can adjust as necessary, but do people really care? Or is it just me?
Eric is the creator of Laravel News and has been covering Laravel since 2012.