0

In my controller file I have this:

$standard_sets = ['A', 'B', 'C', 'D', 'E'];
$exclude_list = ['str1', 'str2', 'str3'];

I'd like to exclude certain rows based on the exclude array. Something like this:

$query->whereIn('cards.setCode', $standard_sets)
->exclude('cards.name', $exclude_list);

What is the right way to write this?

Howard
  • 3,648
  • 13
  • 58
  • 86

1 Answers1

1

How about whereNotIn()?

$query->whereIn('cards.setCode', $standard_sets)
      ->whereNotIn('cards.name', $exclude_list);
lukasgeiter
  • 147,337
  • 26
  • 332
  • 270