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

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}')->group(function () {
    Route::get('user/{id}', function ($account, $id) {

If you was to replace {account} with your language en, fr, de etc and 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.


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.

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


Sign in to participate in this thread!


Your banner here too?

Philipp pmochine Joined 12 Jul 2018


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

Your logo here?

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

© 2024 - All rights reserved.