select * from `orders` where (exists (select * from `repairs` where orders.id = repairs.order_id and repairs.prepayment >= repairs.total * 0.5))
Order::whereHas('repairs' ,function ($query){
$query->where('repairs.prepayment', '>=', 'repairs.total * 0.5');
})->get();
$query->whereRaw('repairs.prepayment >= repairs.total * 0.5'); //так тоже пробовал