Skip to content

Commit

Permalink
fix: i'm glad i wrote a test
Browse files Browse the repository at this point in the history
  • Loading branch information
wescopeland committed Jan 18, 2025
1 parent a2bd959 commit af47e5a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/Support/Routing/HasSelfHealingUrls.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public function getRouteKey(): string

public function resolveRouteBinding(mixed $value, $field = null)
{
// Skip self-healing for internal-api routes.
if (str_starts_with(request()->path(), 'internal-api')) {
return parent::resolveRouteBinding($value, $field);
}

// If it's just a number, redirect to the full slug.
if (is_numeric($value)) {
$model = static::findOrFail($value);
Expand Down

0 comments on commit af47e5a

Please sign in to comment.