skip to Main Content

How Laravel ORM query a string field?

$orderId = 319769; $sql = ShipOrderModel::query()->where('order_id', (string)$orderId); // select * from `hr_ship_order` where `order_id` = 319769 $sql = ShipOrderModel::query()->where('order_id', '319769'); // select * from `hr_ship_order` where `order_id` = 319769 $sql = ShipOrderModel::query()->whereRaw('order_id = "?"', $orderId); //select * from `hr_ship_order` where…

VIEW QUESTION
Back To Top
Search