Wai Yan Hein
Wai Yan Hein

Reputation: 14771

How to access a Laravel project different machine

I am doing a Laravel project. I have to provide REST API from my project for mobile app. But my problem is how can we access Laravel project from different machine using IP address because Laravel using virtual host. When I was using Codeigniter, I can easily access like 10.0.1.9:8080/myproject from different for localhost:8080/myproject. My current Laravel project URL is laravel.bbc:8080/. So how can I access it from different machine? I am using Laravel 5, xampp and my operation system is Windows.

Upvotes: 1

Views: 621

Answers (2)

Wai Yan Hein
Wai Yan Hein

Reputation: 14771

I already solved the problem . The problem was I also having old laravel project . It is also working on virtual . So when I access my new project , it keep mapping to old project . So I removed virtual host of old project . So now I am able to access my project like this 10.0.1.9:8080 . It is working . The topic Jan Zahradník mentioned is also important .

Upvotes: 0

Jan Zahradník
Jan Zahradník

Reputation: 2497

Use static DNS resolve. For Windows there is file in system32 folder, usually C:\Windows\System32\drivers\etc\hosts. Append following line to it:

192.168.1.1 laravel.bbc

Where 192.168.1.1 is IP of your Laravel server.

Upvotes: 1

Related Questions