If you are Working with laravel API and and want to test your app in local with android emulator or your mobile Connected to your Computer, so just follow the below Steps.
As we all know that when we are testing our laravel API in LocalHost, then it runs in our browser but if we try to access the Data with API in our Android App then its not work. So Today i’ll Explain you all,
How to Test Laravel API from Localhost to Android Emulator.
Step 1. First Find out your IPv4 Address by Typing
ipconfig command in your Command Prompt or Power Shell
Step 2. Now run the
php artisan serv --host 192.168 . * . ***
It will start Laravel development server in your ip which is accessible to your android app your are developing and testing in your local Environment. After running the command Laravel development server is started and provide you the server url like this => http://192.168.1.365:8000
Step 3. Now you can provide the above server url in your App and test Laravel API in your Local Environment.