I'm using slug-based routing, like this
myapp.com/posts/first-post
I have a Post entity, and a PostTranslation entity, When I create a Post entity, 2 PostTranslation entities are being created (for each language), and they have an empty slug and title field, so the user can choose this. The issue is that when I want to browse to this post, and the user didn't set a slug yet, it will break. How would you handle this?
Why not add default slugs and then give an option for users to change it. Once they set a new slug you can update the post
Full-stack engineer
Double Prince
Laravel Dev. Vuejs, Tailwind
I had such issues once and resolved it by creating a vue based slug generating system by following this tutorial on Youtube: Build a Slug Generator Vue.js Component (Ep 22) - Build an Advanced Blog_CMS. With this, you can be able to automatically generate a slug for the Post entity before submission. I hope that helps