Skip to content

Commit

Permalink
Merge pull request #17 from Chrissle28/fix/add-localize-abort
Browse files Browse the repository at this point in the history
  • Loading branch information
jannescb authored Apr 26, 2022
2 parents f3d00df + 016c3c8 commit c9d7156
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Localize/LocalizeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ protected function registerTranslatorMacro()
if (lit()->isAppTranslatable()) {
$routes->extend(function (Route $route) {
$route->translator(function ($locale, $slug = null) {
$slug = Page::current()->translate($locale)->t_slug;
$slug = Page::current()?->translate($locale)->t_slug;
if (! $slug) {
abort(404);
}

return ['slug' => $slug];
});
Expand Down

0 comments on commit c9d7156

Please sign in to comment.