4

I'm trying to connect to access my laravel app from a another device on the same network. Is this possible?

3 Answers3

6

You can give access to everyone to your app by using

valet share

If you want to access it only locally, you can edit you hosts file on your other device and bind the valet URL to your first computer ip

192.168.1.19 laravel.dev

You just have to check if your computer allow remote access.

BTW the valet share command is way more easier :)

Mathieu Ferre
  • 4,246
  • 1
  • 14
  • 31
  • don't just simply type 'valet share', also add the site-name of the site you want to share to the command (i had to figure that out first so maybe this comment will help someone) – nerdess Feb 14 '21 at 16:03
2

use Valet share

However this only works if you are not serving the app via https using valet secure.

After running valet share, a URL that looks like "2jd437s.ngrok.io" will be generated. And that's what you will use to visit your app remotely.

To cancel, use Ctrl+c

0

Hope, it will help someone as I've wasted my 1 day to complete this simple heck.

My Goal was: Share my localhost URL as https with external service like Paypal, Stripe.

Steps: My Local URL is: yourdomain.test

Step 1: First secure my local url to enable https:

valet secure yourdomain.test

Step 2: Next Share my localhost to outside of the internet:

valet share https://yourdomain.test

Booooom. Now, You'll get an ngrock URL and that would be pretty awesomely work like this - https://1bba-103-108-147-143.ngrok.io . [Click this URL to browser and you'll able to access your localhost from outside]

Note: This ngrock URL would work upto 2 hour by default. So to solve this please create an ngrock account -

  1. Download ngrock on local - https://dashboard.ngrok.com/get-started/setup

  2. Validate Your ngrock in localhost terminal with authtoken - https://dashboard.ngrok.com/get-started/your-authtoken

Great, now again share your localhost URL -

valet share https://yourdomain.test

It will available on the internet if your local stay alive, there is no time limitation now.

Maniruzzaman Akash
  • 4,610
  • 1
  • 37
  • 34