Closed Dezmonter closed 2 years ago
Hello,
Can you give some more context?
a href="{{ route('web.article.show', $article->slug) }}"
Route::localized(function () {
Route::get('/articles', [ArticleController::class, 'index'])->name('articles');
Route::get('/article/{slug}', [ArticleController::class, 'show'])->name('article.show');
Route::get('/articles/{slug}', [ArticleCategoryController::class, 'show'])->name('article_category.show');
});
Error Route [uk.web.article.show] not defined. ...
Article route list:
GET|HEAD ru/article/{slug} ........................................................................................................................ web.ru.article.show GET|HEAD article/{slug} ........................................................................................................................... web.uk.article.show
UPD! The problem is that I am using RouteServiceProvider to the group web - name.
public function boot()
{
$this->configureRateLimiting();
$this->routes(function () {
Route::middleware('web')
->name('web.')
->group(base_path('routes/web.php'));
});
}
if you remove (->name('web.')) and register manually in each route then it works, but I would like to register name in RouteServiceProvider...
If you add the name in the RouteServiceProvider, it's going to be top level... I don't think there is anything we can do about that...
I do the entire installation according to the instructions, as a result, when going to any page, an error Route [uk.route_name] not defined. what could be wrong?