Support the ongoing development of Laravel.io →
Laravel Packages
Last updated 2 years ago.
0

For subdomain path Laravel and maybe Lumen have a routing pattern design specifically for subdomain content.

here is the snippet taken from the laravel 5.6 documentation:

Sub-Domain Routing Route groups may also be used to handle sub-domain routing. Sub-domains may be assigned route parameters just like route URIs, allowing you to capture a portion of the sub-domain for usage in your route or controller. The sub-domain may be specified by calling the domain method before defining the group:

Route::domain('{account}.myapp.com')->group(function () {
    Route::get('user/{id}', function ($account, $id) {
        //
    });
});

If you was to replace {account} with your language en, fr, de etc and myapp.com with your top level domain then you could use the language as set by your subdomain in this snippet {account} in your controller to dictate what data it grabs from your database or api.

0

Thank you for your reply! So I have created my own package for that. Since I could not find what I wanted elsewhere.

Laravel Tongue

Last updated 5 years ago.
0

Glad to hear you have created a open source package I have added it to my Githubs watch list. Best of luck with your application

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Philipp pmochine Joined 12 Jul 2018

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.