Skip to content

Advanced Scoped Options - Multi-site (domain localization & slug localization) #105

Open
@cdo9

Description

@cdo9

I have a requirement for a website I am building. Like #21 but not exactly the same. I am building a "multi-site", some of the sites use domain localization, others use slugs).

I wanted to use Scoped Options to do something like this :

url locale
firstwebsite.test/en en
firstwebsite.test/fr fr
firstwebsite.test/pt pt
secondwebsite.test en
deuxiemesite.test fr
segundosite.test pt
Route::domain('firstwebsite.test')->group(function () {
        Route::localized(function () {
                Route::get('/', [\App\Http\Controllers\HomeController::class, 'index']);
        }, ['supported_locales' => ['en', 'fr', 'pt',]]);
});
Route::pattern('secondwebsite', 'secondwebsite.test|deuxiemesite.test|segundosite.test');
Route::domain('{secondwebsite}')->group(function () {
        Route::localized(function () {
            // Home
            Route::get('/', [\App\Http\Controllers\HomeController::class, 'index']);
        }, ['supported_locales' => [
                'en' => 'secondwebsite.test',
                'fr' => 'deuxiemesite.test',
                'pt' => 'segundosite.test',
           ]]);
});

Do you think it will be possible to update the Scoped Options to make it support the domains in "supported_locales" ? In my use case config will never be used, only Scoped Options.

I would love to build this for this package and make a PR. If you are ok with that I would love to have some hints/indications on the way you see this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions