Managing Wildcard Subdomains in Laravel Homestead on Ubuntu

PHP
Imagine the scenario where you have multiple subdomains, such as multiple locales for the internalization of your application served as en.example.app and es.example.app; you don't need to put each of them as a seperate entry to your both homestead config file and the hosts file if all of them will be served from the same application. There is of course an easier way. 

Let's assume our application is located within the ~/Code/Example folder and we want to map it to example.app, furthermore, the ip address assigned to our box is 192.168.10.10
$ nano ~/Homestead/Homestead.yaml
The most simple Homestead config will be like below.
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub

keys:
- ~/.ssh/id_rsa

folders:
- map: ~/Code/Example
to: /home/vagrant/Code/Example

sites:
- map: example.app
to: /home/vagrant/Code/Example/public

databases:
- homestead
Then, ssh into your vagrant box and edit the nginx.conf of the example.app.
$ cd ~/Homestead && vagrant up && vagrant ssh
$ sudo nano /etc/nginx/sites-available/example.app
And just add the wildcard entry to the server_name.
server_name example.app *.example.app
And reload the nginx configuration.
$ sudo service nginx reload
$ exit
Then on your local machine, add a dnsmasq entry.
$ sudo nano /etc/NetworkManager/dnsmasq.d/local
Just add the entry below.
address=/example.app/192.168.10.10
Finally, restart the network-manager.
$ sudo service network-manager restart
Now everything should be ok. You don't need to add individual entries for each of the subdomains of your application. For instance, both en.example.app and es.example.app will be served without adding a seperate configuration for each.