Closed robertnicjoo closed 7 years ago
same error.
$localizer = \App::make(\Waavi\Translation\UriLocalizer::class);
Route::group(['prefix' => $localizer->localeFromRequest(), 'middleware' => 'localize'], function () { Route::get('/', ['uses' => 'PostController@index', 'as' => 'post.index']); });
seems to solve, but is a really bad practice!!
Did you add UriLocalizaer
to the facades array in app.php
?
At first add the following alias to your config/app.php aliases:
'aliases' => [
/* ... */
'UriLocalizer' => Waavi\Translation\Facades\UriLocalizer::class,
];
Then you need to clear config cache ... execute this command by cmd:
php artisan cache:clear
if you face this error:
In web.php line 14:
Class 'UriLocalizer' not found
go to your routes and delete line error line ... and re-execute command "php artisan cache:clear" in cmd then return line which you deleted ...
I just install this but confuse how to work with it?
I just add
as my homepage and i get error
Class 'UriLocalizer' not found
how should i run this?