codezero-be / laravel-localized-routes

⭐️ A convenient way to set up and use localized routes in a Laravel app.
MIT License
504 stars 46 forks source link

Problem on subdomains #114

Open bobitza opened 2 months ago

bobitza commented 2 months ago

I have laravel 11 and get this error: Missing required parameter for [Route: ro.category.os] [URI: ro] [Missing parameter: subdomain].

this is the url: http://mac.laravel.baa/ The error is when i make dropdown for language with this href: <a class="dropdown-item" href="{{ Route::localizedUrl($locale) }}"> this is the route rule:

    //--Categories 'windows', 'mac', 'linux', 'android', 'ios', 'huawei', 'categories
    Route::pattern('subdomain', 'windows|mac|linux|android|ios|huawei|categories');
    Route::domain('{subdomain}.'.config('app.domain'))->middleware('check.os.subdomain')->group(function (){
        Route::localized(function () {
            Route::get('/', [OsApps::class, 'index'])->name('category.os');
        });
    });