I'm using eager loading, and a lot of the time the primary key id is null
Eloquent is still running the query for the null values:
select * from `continents` where `continents`.`id` in ('1', '3')
select * from `countries` where `countries`.`id` in ('')
select * from `dependencies` where `dependencies`.`id` in ('')
select * from `macro_regions` where `macro_regions`.`id` in ('')
The last 3 queries are useless, but eloquent should know that really, is there any way around it to say "if all the values are null, don't bother with the query"?
I think a $foreign variable on the Model could potentially be the way forward, because obviously in some instances such as TEXT types or VARCHAR you may want to search on empty strings
Thanks for your help, I tried googling but my skills obviously aren't as good as yours