John Davidson

php - Laravel spatie/laravel-translatable

0 comments
Message:


this my route


Route::group(
[
'prefix' => LaravelLocalization::setLocale(),
'middleware' => [ 'localeSessionRedirect', 'localizationRedirect', 'localeViewPath','auth']
], function(){


this is working but I want to switch locale in blade like this


  <a  href="{{\App::setLocale('en')}}" >en</a>
<a href="{{\App::setLocale('uz')}}" >uz</a>

but it is not working , can you give some advise ??? What I should do?



My Answer:
'/products', 'as' => 'products.'], function () {
Route::get('/', 'ProductController@index')->name('index');
Route::get('/{product}', 'ProductController@show')->name('show');
});

Rate this post

3 of 5 based on 3965 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us