I am using Laravel 5.7 version.
I would like to use multiple eager loading with where clauses.
I have laravel simplified.
$query = Employee::with(['User','Company','Client'])
->select(*)->whereRaw("(User.id <> 0 and Company.name LIKE %A%) OR Client.id <> 0)")
I am using eager loading to avoid JOIN statement.
But the problem is the error message says User.id is unknown column in where clause.
I believe the other two would be unknown columns as well.
Any ideas would be appreciated.