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
Back To Top
Search