i need tutorial or explain with code
Hi, you can use the Route::domain
function in Laravel.
You can find an example at https://github.com/spatie/spatie.be/blob/main/routes/web.php
You can find the documentation on Route::domain
at https://laravel.com/docs/10.x/routing#route-group-subdomain-routing
Additionally, here is a code sample, written in Laravel 10.
Route::domain('{account}.example.com')->group(function () {
Route::get('user/{id}', function (string $account, string $id) {
// ...
});
});
If you feel like my answer has helped you, please mark it so others can find it!















