php - Laravel With Wherehas -


I am using a query to get companies related to a city that is related to an event.

$ Companies = Event :: Search ($ ID) - & gt; City-> Companies;

Now in my opinion I am outputting to companies who work as the following by companies

  @forach ($ companies) $ Company as a) @foreach ($ company-> person $ as individuals) ... @andencheche@andenauch  

The only problem is to show me this also That companies that do not have a person

So by any thought how can I identify myself only Those who have companies of individuals

where I was thinking, but I can not wrap myself around the argument of combining two.

Thank you!

I'm not sure if this will work, but you can try it with:

$ companies = event :: search ($ id) - & gt; City-> Companies () - & gt; Is ('Individuals') - & gt; (Get);

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -