where('user_contition', '=', 1); i think you need '1' (not sure just a guess)
did try this - but the error remains the same...
Maybe the whereHas() method helps. Not exactly a join, but it will do what you want.
$posts = Post::whereHas('comments', function($q)
{
$q->where('content', 'like', 'foo%');
})->get();
There is no where
clause on a join
row. Either use it on your parent query or use another on
.
DB::table('users')
->join('contacts', function($join) {
$join->on('users.id', '=', 'contacts.user_id');
})
->where('contacts.user_condition', 1)
->get();
DB::table('users')
->join('contacts', function($join) {
$join->on('users.id', '=', 'contacts.user_id');
$join->on('contacts.user_condition', '=', DB::raw(1));
})
->get();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community