skip to Main Content

Mysql – Passing laravel eloquent query params dynamically

I have the following query params in string format $query = '->whereIn('short_code', ["9999"])->whereBetween('request_timestamp', [request('startTime'), request('endTime')])'; How do i pass it to the eloquent? Am trying to achieve something like this InboundMessage::query()->{$query}; Am getting the error below Property [->whereIn('short_code', ["9999"])->whereBetween('request_timestamp', [request('startTime'),…

VIEW QUESTION

Query Builder OR and IS NULL in Laravel 9

I have a query like this SELECT ruangans.nama_ruangan, beds.id AS idBed, beds.nomor_bed, pasiens.nama, pasiens.status FROM `beds` JOIN ruangans ON beds.id_ruangan = ruangans.id LEFT JOIN pasiens ON beds.id = pasiens.id_bed WHERE pasiens.status != 'Sudah Rawat Inap' OR pasiens.status IS NULL; I'm…

VIEW QUESTION

Not counting duplicate data – Laravel

I need a querybuilder query that calculates how many different people the user is messaging without counting the repetitive data. database photo Example: conver_user_id = 165, conver_user_seller_id = 156 conver_user_id = 165, conver_user_seller_id = 156 conver_user_id = 165, conver_user_seller_id =…

VIEW QUESTION
Back To Top
Search