title: Laravel Query Builder : Where pivot not in
body: <p><code>wherePivotIn</code> is mentionend <a href="https://laravel.com/docs/5.5/eloquent-relationships#many-to-many" rel="nofollow noreferrer">here</a> (under <em>Filtering Relationships Via Intermediate Table Columns</em>) but I can't find anything about the opposite function.</p>
  
  <p>As the <code>wherePivotIn</code> already exists but not the <code>wherePivotNOTIn</code>, I edited this file : <code>vendor/laravel/framework/src/Illuminate/Database/Eloquant/Relations/BelongsToMany.php</code></p>
  
  <p>And added this function</p>
  
  <pre><code>public function wherePivotNotIn($column, $values, $boolean = 'and', $not = false)
      {
          $this-&gt;pivotWhereIns[] = func_get_args();
  
          return $this-&gt;whereNotIn($this-&gt;table.'.'.$column, $values, $boolean, $not);
      }
  </code></pre>
  
  <p>Now the <code>wherePivotNotIn</code> exist and is working. But my question is: </p>
  
  <p>Is it safe to update this file?
  In case of update, I guess I will lose this...</p>