Example #1
0
 /**
  * Remove scope from the query.
  *
  * @param \Illuminate\Database\Eloquent\Builder $builder
  * @param \Illuminate\Database\Eloquent\Model $model
  * @return void
  */
 public function remove(Builder $builder, Model $model)
 {
     $query = $builder->getQuery();
     $column = $model->getQualifiedSharpLanguageColumn();
     $bindingKey = $this->lang;
     foreach ((array) $query->wheres as $key => $where) {
         if ($this->isSharpLanguageConstraint($where, $column)) {
             $this->removeWhere($query, $key);
             // Here SoftDeletingScope simply removes the where
             // but since we use Basic where (not Null type)
             // we need to get rid of the binding as well
             $this->removeBinding($query, $bindingKey);
         }
     }
 }