I 'm trying to create a very simple Laravel web service for my mobile app but I have no idea why Laravel can't return result for my mobile app. Here is the simple code
routes.php Route::get('/', 'PagesController@home');
PagesController.php public function home() { return Response::json(array('name' => 'Steve', 'state' => 'CA')); }
In my browser, i type in http://localhost:8000 and it successfully return the result for me as below
{"name":"Steve","state":"CA"}
So, i thought that my web service has been successfully done but when I try to use my mobile app to access, it return blank. I use my mobile app to access online free json web service such as http://date.jsontest.com, it return result without any problem. So, I 'm sure is my problem. What had I done wrong?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community