0

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?

Radogost
  • 143
  • 5
  • 16

1 Answers1

0

You can use DB::raw.
For Example :

MODEL::Where(...)->where(DB::raw("functionX(Id, 1) IN ('1','2','3')")->get()
Abdo Arj
  • 1
  • 2