Skip to content
Advertisement

Eloquent relationship where not in sub-query

I have got a relationship where I select all row’s based on the category, however I need to exclude some of these if they are within a sub query.

JavaScript

So above is my code, nearly works as I want it, however it seems that the $q variable doesn’t have the table name within the query, below is the query outputted:

JavaScript

This is the relationship:

JavaScript

Advertisement

Answer

You can specify what table you want to use.

JavaScript

I don’t know what exactly the table name should be, hence the placeholder.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement