Skip to content

Commit

Permalink
Fixed major route path setting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
divineniiquaye committed Apr 17, 2022
1 parent c15e09c commit 67a6c5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Traits/DataTrait.php
Expand Up @@ -76,10 +76,12 @@ public function path(string $pattern)
throw new UriHandlerException(\sprintf('The route pattern "%s" is invalid as route path must be present in pattern.', $pattern));
}

\preg_match(Route::PRIORITY_REGEX, $this->data['path'] = '/' . \ltrim($matches[3], '/'), $pM);
\preg_match(Route::PRIORITY_REGEX, $resolved = '/' . \ltrim($matches[3], '/'), $pM);
$this->data['prefix'] = !empty($pM[1] ?? null) ? $pM[1] : null;
}

$this->data['path'] = $resolved ?? '/' . \ltrim($pattern, '/');

return $this;
}

Expand Down

0 comments on commit 67a6c5c

Please sign in to comment.