5

How to use Laravel Eloquent ORM to make an OR statement?

I know I can make multiple select like this (AND)

Order::where('id', '<', $myid)->where('finance','ok')->get();
giannis christofakis
  • 8,201
  • 4
  • 54
  • 65
katerinaMark
  • 53
  • 1
  • 3

1 Answers1

9
Order::where('id', '<', $myid)->orWhere('finance','ok')->get();

That gives you the OR

http://laravel.com/docs/queries#advanced-wheres gives you more details but it's the orWhere that is interesting to us here.

ridecar2
  • 1,968
  • 16
  • 34