Quick question that is already killing me for days. With Laravel I am trying to use different languages.
English and Japanese
This works in the route like this.
Route::group([
'prefix' => '{lang}',
'where' => ['lang' => '(jp|en)'],
'middleware' => 'Language'
], function() {
Route::get('/blogs', 'BlogController@index')->name('main-blog');
Route::get('/blog/{postId}/{postTitle}', 'BlogController@post');
});
This works when I am visiting the "/blogs" page. It changes between languages.
Now when I visit the "/blog/{postId}/{postTitle}" page I can't access the posted parameter anymore within my controller.
Somehow it only shows the "lang" parameter. What would be the right way to access a parameter when using a prefix.
When I don't use the prefix it works like a charm.
My Controller;
public function post($blog_id, $blog_title)
{
// Do something
}
Help is highly appreciated. I have been banging my head with this for days now.
Wesley
post()method, but your controller doesn't seem to implement one from the code you posted.