Skip to content

[V5] how to get values from ManyToMany relationship on the Middleware? #2190

Answered by McSneaky
vicainelli asked this question in Help
Discussion options

You must be logged in to vote
// await auth.user.preload('establishments') (deprecated)
await auth.user.load('establishments')
const userEstablishments = auth.user.establishments

It works if you preload it first in the middleware

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@vicainelli
Comment options

@dramoslance
Comment options

Answer selected by vicainelli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants