How can I make an entries query based on currentUser is author or relatedTo currentUser My project requires a notifications area. I want to list all notification entries that were created by currentUser or sent to currentUser.
I can do created by = craft.entries().section('thename').authorId(currentUser.id).all()
I can do sent to = craft.entries().section('thename').relatedTo({ targetElement: currentUser, field: 'thefield' }).all()
But is there a single query that will get both?
A blanket relatedTo query should do the trick.
craft.entries().section('thename').relatedTo(currentUser).all()