can we write the query in laravel query builder

  laravel, laravel-query-builder, query-builder
select * FROM (SELECT o.customerID,o.slot,o.Mobile,o.orderNumber as orderNumber,o.Name,
                        o.srType,s.startTime,s.endTime,DATE_FORMAT(r.roasterDate, '%d-%m-%Y')AS roasteDate, 
                                                as oltname,o.portId,o.slaClock ,dop.podName,st.statusFFA as srStatus
                            from order o LEFT JOIN slot s ON s.slotId=o.slotId 
                                                Left join roast r ON o.roasterId=r.roasterId
                            LEFT JOIN engins e ON o.pengId=e.userId
                            LEFT JOIN tlo  ON tlo.deviceId=o.deviceId 
                                                    LEFT JOIN dop on dop.podCode=tlo.podCode
                        LEFT JOIN transition_status st ON st.statusReasonCRM=o.srStatus AND o.acknowledge_status=st.orderTransition                             where e.emailId='$emailId' AND o.status=1 AND o.slot='ERF' AND o.acknowledge_status=st.orderTransition
                        )t  GROUP BY orderNumber ORDER BY roasteDate  DESC

I want to write this query by using laravel query builder but not able to write a logic .

Source: Laravel

Leave a Reply