Level 5
You can join your Orders table to UserOrderArriveAddress table and then add a where clause to only get the results when arrive_location == new
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i have field named arrive_location arrive location have just two value (exist, new)
in eloquent
$orders = Orders::select('id', 'users_id', 'arrive_location')
->with('users:id,fname,lname,telno')
i want if arrive_location == new, to make another query to get data
UserOrderArriveAddress::select('order_id','addresse_id');
Please or to participate in this conversation.