Closed Heqma closed 3 years ago
@Heqma
You need to pass a slug to your route:
localized_route('page.show', ['slug' => 'hello-world']);
Ok, but doing this way, slug isn't translated.. and prefix isn't work.. this 2 translated slugs.. are working on 2 prefixes:
/o-nas ------ /en/o-nas /about-us ------ /en/about-us
primary lang/pl/routes.php 'o-nas' => 'o-nas',
secondary lang/en/routes.php translated & it should be with default with "en" prefix 'o-nas' => 'about-us',
Page Route
Route::multilingual('{slug}', 'PagesController@show')->name('page.show');
Page Front
<a class="nav-link" href="{{ localized_route('page.show', ['slug' => 'o-nas']) }}">{{ __('links.O nas') }}</a>
ERROR: Missing required parameters for [Route: pl.page.show] [URI: {slug}] Missing required parameters for [Route: en.page.show] [URI: en/{slug}]
Route
page controller
Page model
Inside blade
{{ localized_route('page.show') }}
or{{ localized_route('page.show')->whereIn('id', [5]) }}
is not work