Skip to content

Commit e1e5f84

Browse files
committed
Refactor
1 parent 216d375 commit e1e5f84

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/AttributeResolver.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,10 @@ protected function resolvePropertyRef(PropertySchema $property, Attribute $attri
492492

493493
public static function relationName(string $propertyName, ?string $fkColumnName): string
494494
{
495+
$fkColumnName = (string) $fkColumnName;
495496
$relationName = $propertyName;
496-
if (!str_contains((string) $fkColumnName, '_')) {
497-
$relationName = strtolower((string) $fkColumnName) === strtolower($relationName) ? $relationName . 'Rel' : $relationName;
497+
if (!str_contains($fkColumnName, '_')) {
498+
$relationName = strtolower($fkColumnName) === strtolower($relationName) ? $relationName . 'Rel' : $relationName;
498499
}
499500
return $relationName;
500501
}

0 commit comments

Comments
 (0)