Skip to content

Commit

Permalink
Fixed: Upgrading from 3.2.1 to 3.5.0 produces error "Undefined column…
Browse files Browse the repository at this point in the history
…: 7 ERROR" #172 (#174)
  • Loading branch information
vedmant authored Mar 20, 2024
1 parent 571f09c commit 2fae3ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Mixins/JoinRelationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Database\Query\Expression;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Kirschbaum\PowerJoins\JoinsHelper;
use Kirschbaum\PowerJoins\PowerJoinClause;
Expand Down Expand Up @@ -378,7 +379,7 @@ public function orderByPowerJoins(): Closure
)
)
->groupBy(sprintf('%s.%s', $this->getModel()->getTable(), $this->getModel()->getKeyName()))
->orderBy(sprintf('%s', $aliasName), $direction);
->orderBy(DB::raw(sprintf('%s', $aliasName)), $direction);
} else {
if ($column instanceof Expression) {
$this->orderBy($column, $direction);
Expand Down

0 comments on commit 2fae3ac

Please sign in to comment.