Illuminate\Database\Query\Builder::whereNotIn PHP Method

whereNotIn() public method

Add a "where not in" clause to the query.
public whereNotIn ( string $column, mixed $values, string $boolean = 'and' ) : Builder | static
$column string
$values mixed
$boolean string
return Builder | static
    public function whereNotIn($column, $values, $boolean = 'and')
    {
        return $this->whereIn($column, $values, $boolean, true);
    }

Usage Example

Example #1
0
 /**
  * Store settings in the database.
  */
 public function save()
 {
     if ($this->unsaved) {
         $all = $this->getData();
         $data = array_dot($all);
         foreach ($data as $key => $value) {
             $this->options->updateOrCreate(compact('key'), compact('key', 'value'));
         }
         $this->options->whereNotIn('key', array_keys($data))->delete();
         $this->unsaved = false;
     }
 }
All Usage Examples Of Illuminate\Database\Query\Builder::whereNotIn