Skip to content

Commit

Permalink
Merge pull request #62 from ricardogobbosouza/v2
Browse files Browse the repository at this point in the history
fix: preserve binding fields
  • Loading branch information
chinleung authored Nov 10, 2021
2 parents 2d8e149 + 293a0b6 commit 336560b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/MultilingualRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ protected function generateRoute(string $key, $handle, string $locale, array $op
*/
protected function finalizeRoute(Route $route, string $key, string $locale, array $options): Route
{
$bindingFields = method_exists($route, 'bindingFields') ? $route->bindingFields() : [];

$this->applyConstraints($route, $locale, $options);

if ($prefix = $this->generatePrefixForLocale($key, $locale)) {
Expand All @@ -201,7 +203,13 @@ protected function finalizeRoute(Route $route, string $key, string $locale, arra
)
));

return $this->cleanUniqueRegistrationKey($route, $locale);
$route = $this->cleanUniqueRegistrationKey($route, $locale);

if (method_exists($route, 'setBindingFields')) {
$route->setBindingFields($bindingFields);
}

return $route;
}

/**
Expand Down

0 comments on commit 336560b

Please sign in to comment.