I am a writing a query in laravel 5.3 but query not return any data
when i run query in direct in mysql then it's work
query here
return DB::table('friends')
->join('users', function ($join) use ($user_id){
$join->on(function ($joinin) use ($user_id){
$joinin->where('friends.user_one_id', '=', 'users.id')
->where('friends.user_one_id', '!=',$user_id);
})->orwhere(function ($andwhere) use ($user_id){
$andwhere->where('friends.user_two_id', '=' ,'users.id')
->where('friends.user_two_id', '!=' ,$user_id);
});
})->where('status','=','1')
->where(function ($query) use ($user_id){
$query->where('user_one_id', '=', $user_id)
->orwhere('user_two_id', '=', $user_id);
})->get();
and it possible that make this query using Eloquent ORM