diff --git a/Traits/QueryTrait.php b/Traits/QueryTrait.php index 22639d0..deca613 100644 --- a/Traits/QueryTrait.php +++ b/Traits/QueryTrait.php @@ -401,7 +401,7 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq public function from(string|Closure $tableName): static { if ($tableName instanceof Closure) { - $this->from = call_user_func($tableName, $this->queryInstance()); + $this->from = $this->makeClosureFunction($tableName); } else if (class_exists($tableName)) { $this->from = (new $tableName)->getTable(); } else {