Basit .htacess veya ngnix.conf ile url rewrite edebilirsiniz.
Örnek vhost ;
<VirtualHost *:80>
ServerName website.com
ServerAlias *.website.com
</VirtualHost>
Örnek laravel route :
Route::get('/', function () {
$url = parse_url(URL::all());
$domain = explode('.', $url['host']);
$subdomain = $domain[0];
$name = DB::table('users')->where('name', $subdomain)->get();
dd($name);
});umarım fikir verebilir. kolay gelsin.