Skip to content

Commit

Permalink
Delete without subquery
Browse files Browse the repository at this point in the history
  • Loading branch information
acasar committed Oct 31, 2016
1 parent 106be9c commit 4427472
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,9 @@ protected function i18nDeleteQuery($withGlobalScopes = true)
$subQuery = $withGlobalScopes ? $this->toBase() : $this->getQuery();
$subQuery->select($this->model->getQualifiedKeyName());

$query = $this->i18nQuery();
$query->whereSubQuery($this->model->getForeignKey(), $subQuery);

return $query;
return $this->i18nQuery()->whereIn(
$this->model->getForeignKey(), $subQuery->pluck($this->model->getKeyName())
);
}

/**
Expand Down

0 comments on commit 4427472

Please sign in to comment.