key = Attribute::handleArrayField($this->key); $this->foreignKey = Attribute::handleArrayField($this->foreignKey); } ## AWAITING THE Closures in constant expression from PHP 8.5 ! public function foreignKey(? Repository $repository = null) : mixed { if (is_string($this->foreignKey)) { if (str_starts_with($this->foreignKey, 'fn(') && str_contains($this->foreignKey, '=>')) { $closure = eval("return {$this->foreignKey};"); return $repository ? $closure($repository) : $closure; } return $this->entity::field($this->foreignKey, $this->alias); } return $this->foreignKey; } public function isOneToOne() : bool { return true; } public function isOneToMany() : bool { return false; } public function isManyToMany() : bool { return false; } }