Fetching records with slug instead of ID

后端 未结 2 1520
抹茶落季
抹茶落季 2021-01-02 20:23

I\'m currently trying to find the best way (in term of usability and performance) when dealing with a situation like fetching records tagged with a specific tag, or category

2条回答
  •  感动是毒
    2021-01-02 20:57

    The first one is better, but can the slugs possibly be changed? In that case you'd need to have a redirect table (e.g. "some-article-about-dogs" is now "article-about-dogs-and-cats").

提交回复
热议问题