Slug
Slug provides an easy way to create pretty URLs for your model.
Usage
If the source field called Name
, then use *WithSlug
which is NameWithSlug
as the slug field name, the field type should be slug.Slug
type User struct {
gorm.Model
Name string
NameWithSlug slug.Slug
}