RELATIONTABLE
ID
CONTACTID
CUSTID
NAME
PHONE
CONTACTTABLE
ID
CONTACTID
NAME
PHONE
Search on result of other query | return collection
I made a searchbar in which the customer wants to search their relations and contacts (the contacts are linked to that company by CONTACTID in both tables)
so if someone provides input, I query via async. However, I can't wrap my head around this.
As soon as someone provides input, I need to search relations table and contacts table - simultaniously. I want to just provide the output of relations table.
so if we find that the userinput matches an entry in the contact table, I want to take that CONTACTID and search in the relations table and return that result
I've been stuck a lot and I've also looked into eloquent relations but I didn't figure that out.
Please or to participate in this conversation.