I have a vehicle listing page with filters. I have created a scope for applying some filters to the vehicles table. The scope make use of eloquent whereHas method. But it has serious performance issues while executing query because I see each whereHas is converted to subqueries instead of Join. I need you to convert the whereHas to Joins.
See my function here
[url removed, login to view]
Only experts may apply after going through code. Will not be paying for half work, need to convert all whereHas to join for increased performance.