Skip to content

Commit

Permalink
Update src/Illuminate/Database/Eloquent/Relations/Relation.php
Browse files Browse the repository at this point in the history
Co-authored-by: Caleb White <[email protected]>
  • Loading branch information
taylorotwell and calebdw authored Jun 17, 2024
1 parent fbdcdbe commit eebb496
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/Illuminate/Database/Eloquent/Relations/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,13 +509,7 @@ public static function getMorphedModel($alias)
*/
public static function getMorphAlias(string $className)
{
foreach (static::$morphMap as $alias => $morphedClass) {
if ($morphedClass === $className) {
return $alias;
}
}

return null;
return array_flip(static::$morphMap)[$className] ?? null;
}

/**
Expand Down

0 comments on commit eebb496

Please sign in to comment.