# defineEntityId

This composable is used in useEntity to define the entityId based on the given entity.

/customers/123-456/contacts/567-890

When you give customers the next slug is used: 123-456. When you give entity contacts the entityId is 567-890.

  • /customers/123-456/contacts/new
  • /customers/123-456/contacts

Based on these two routes the entityId is undefined.

TIP

The entityId is automatically updated when the route changes, because of the reactive bindings in Vue.