Skip to content

Commit 127334a

Browse files
committed
passthru from property to underlying query object
1 parent 24fc129 commit 127334a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Illuminate/Database/Eloquent/Builder.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ class Builder
7373
*/
7474
protected $onDelete;
7575

76+
/**
77+
* The properties that should be returned from query builder.
78+
*
79+
* @var string[]
80+
*/
81+
protected $propertyPassthru = [
82+
'from',
83+
];
84+
7685
/**
7786
* The methods that should be returned from query builder.
7887
*
@@ -1600,6 +1609,10 @@ public function __get($key)
16001609
return new HigherOrderBuilderProxy($this, $key);
16011610
}
16021611

1612+
if (in_array($key, $this->propertyPassthru)) {
1613+
return $this->toBase()->{$key};
1614+
}
1615+
16031616
throw new Exception("Property [{$key}] does not exist on the Eloquent builder instance.");
16041617
}
16051618

0 commit comments

Comments
 (0)