0

How can I do

"SELECT * FROM table WHERE quote_id = ".$id." AND status = 7 OR status = 8"

using Laravel queries.

So far what I tried doing is:

Test::where("quote_id", $id)->whereRaw("booking_status_id = 7 OR booking_status_id = 8")->get();
Daniel
  • 205
  • 2
  • 12

1 Answers1

1

try this

Test::where("quote_id", $id)
 ->where(function($query) {
 $query->where('booking_status_id',7)
 ->orWhere('booking_status_id',8);
 })
->get(); 
Rp9
  • 1,955
  • 2
  • 23
  • 31