1

I have a data table with several status condition. For example:
status = "pending","approved","rejected".

How to use eloquent query to select the column for status "pending", "rejected" only?

felipsmartins
  • 13,269
  • 4
  • 48
  • 56
masterhunter
  • 551
  • 2
  • 10
  • 29
  • http://stackoverflow.com/questions/19325312/how-to-create-multiple-where-clause-query-using-laravel-eloquent – victor May 11 '17 at 14:19

1 Answers1

1

If you need to select data where status is pendning or rejected, use whereIn():

Model::whereIn('status', ['pending', 'rejected'])->get();

Or orWhere():

Model::where('status', 'pending')->orWhere('status', 'rejected')->get();
Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279