Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 789eb2e

Browse files
committed
fix columns that are already prefixed
1 parent af303c7 commit 789eb2e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Eloquent/Builder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,10 @@ protected function createSelectWithConstraint($name)
11451145
{
11461146
return [explode(':', $name)[0], static function ($query) use ($name) {
11471147
$query->select(array_map(static function ($column) use ($query) {
1148+
if (Str::contains($column, '.')) {
1149+
return $column;
1150+
}
1151+
11481152
return $query instanceof BelongsToMany
11491153
? $query->getRelated()->getTable().'.'.$column
11501154
: $column;

0 commit comments

Comments
 (0)