How to use quick with multiple tables

I have a query to get all,

function index( event, rc, prc ) {

prc.concerns = getInstance( “Concern” ).all();
event.setView( “concerns/index” );
}

This obviously gives me all of the concerns. If I only want the concerns associated with a user it involves another table. I have user_concern with userIDfk and concernIDfk and I have concerns table with concernsID that maps to the other tables fk. I don’t know how to do this with the quick method?

Thank you so much

I believe you are looking for a belongsToMany relationship.

Once you set that up on the user side, you can query that through the user entity.

getInstance( "User" ).findOrFail( 1 ).getConcerns();

(Usually I’m grabbing the user off of the logged in user, not a random id :wink: )