Laravel Valet with localtunnel.me

There is a very power command with Laravel Valet which is valet share. However, the problem is the URL will not reserve. Once you restart the process, there will be new URL will be generated.

When I due with payment gateway, they required an URL can be accessed from outside. So localtunnel.me is the solution to keep the sub-domain.

Once you install localtunnel.me, here is the command:-

>lt --port 80 --subdomain mysubdomain --local-host foldername.dev

It will proxy the valet URL to match with the localtunnel URL.

However, you will still have another issue, all your website link is not showing mysubdomain.localtunnel.me, it is still pointing to foldername.dev.

In this case you can use Laravel URL class, URL::forceRootUrl('http://mysubdomain.localtunnel.me/');

It will change the URL to the input that you had set.

I hope this tutorial can help you in your development. Happy Coding~