I have a query like is
MODEL::Where(...)
->whereRaw(...)
->get()
I want to add my SQL
function before ->get().
Here, I want to add this raw:
AND functionX(Id, 1) IN ('1','2','3');
I try to whereRaw
but it does not work. Any ideas?
I have a query like is
MODEL::Where(...)
->whereRaw(...)
->get()
I want to add my SQL
function before ->get().
Here, I want to add this raw:
AND functionX(Id, 1) IN ('1','2','3');
I try to whereRaw
but it does not work. Any ideas?
You can use DB::raw.
For Example :
MODEL::Where(...)->where(DB::raw("functionX(Id, 1) IN ('1','2','3')")->get()