Reputation: 256
I want to create API in laravel which gives data return. I want to get data from this link into my laravel controller.
Upvotes: 1
Views: 1811
Reputation: 5041
This can be done by pulling in guzzle. Try: https://github.com/guzzle/guzzle
$client = new Client();
$body = $client->get('mtaapi.herokuapp.com/stations')->getBody();
$obj = json_decode($body);
Hope this helps you!!
Upvotes: 1
Reputation: 4598
You need to do a request to that url from your controller. This can be done by pulling in guzzle. Please see the readme of this repository: https://github.com/guzzle/guzzle
Upvotes: 1