$result = User::where(function ($query) {
$query->select('users')->
with('roles')->
whereHas('roles', function ($q) {
$q->where('slug', 'translator');
$q->orWhere('slug', 'user');
})->
orWhereDoesntHave('roles');
})->where('email', 'like', '%' . $str . '%')
->orWhere('phone', 'like', '%' . $str . '%')->
get();