1

I'm running a Laravel project locally using Herd and sometimes XAMPP on my Windows machine.
I’m trying to share a live link so that other devices (phones, laptops, etc.) on the same network can access the project.

Here’s what I’ve tried:

  • Accessing via local IP (http://192.168.x.x:8000)

  • Running php artisan serve --host=0.0.0.0

  • Using ngrok

  • Using localtunnel

  • Using ipconfig to get IPv4 and connect

  • Using Herd’s exposed URLs

The problems I'm facing:

  1. Some links work on my phone but not on other PCs.

  2. When the link works, CSS/JS styling does not load on other devices.

  3. Vite assets only load properly on my local machine.

  4. I want a link that works on every device (same network or internet) with full styling.

Environment:

  • Windows 10

  • Laravel 12

  • Herd (for PHP)

  • XAMPP (sometimes for MySQL)

  • Vite for asset bundling

  • npm run dev running locally

Question:
Is there any reliable way to expose my Laravel + Vite project so that other devices can access it with full CSS and JS working?
Is there a better method than ngrok/localtunnel when using Herd + Vite?

Also open to solutions like temporary deployment or alternative local hosting setup.

14
  • 1
    If you've got XAMPP then are you using the Apache instance that comes with it to serve the Laravel application? If so then this ought to get you started configuring it to allow access from the rest of your LAN. You might also need to do some firewall configuration in Windows. If you want to make a test version available to other users it would probably be better to actually use a proper server for it Commented Nov 18 at 13:17
  • 1
    If you view the site in a browser, then view the source of it, what does it show for the Url for the css and javascript? Commented Nov 18 at 14:41
  • 1
    XAMPP is just an installer for some components. My question was: are you using Apache to serve the Laravel site? Currently if you want to view the site locally, what URL do you go to? Herd comes with nginx I think...so maybe you're using nginx while developing, rather than Apache? It sounds like part of the problem here is that you actually have no clue how your environment is set up and being used. We can't give you advice if you can't tell us what's actually going on in your system. Again though...I wouldn't be exposing your dev enviromment to other users anyway, it'll be too unstable. Commented Nov 18 at 15:05
  • 2
    P.S. I want a link that works on every device (same network or internet) ...saying you want it available to internet users contradicts your earlier description. Make your mind up and clarify your question. The difference is significant. Also, opening things up to the public internet comes with a lot of security risks and, given the level of experience and knowledge you appear to have, I would strongly suggest that you're not in a position to consider doing that right now. Use a proper hosting company if you want to put the site live to the general public. Commented Nov 18 at 15:13
  • 2
    It also sounds a bit that what you are really looking for is a better fitting staging/test system. If you try to solve the problem the internet will bring to your desk within your development system, you will only have fun if you like to play whack-a-mole. Clearly define the boundary between the lab testing and development testing, then start building your lab and put all the devices that are required to test into your lab, then use your lab to define the criteria how the test-plan for each device looks like etc.. It makes no sense if you can't reproduce independent to a users configuration. Commented Nov 18 at 16:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.