I'm trying to fetch JSON data from an API and it's returning null. Here is my code:
$movie_url = 'http://www.omdbapi.com/?i='.$request->imdb_id.'&r=json';
$movie_data = json_decode($movie_url, true);
echo $movie_url;
echo dd($movie_data);
And if I go to the actual URL above http://www.omdbapi.com/?i=tt0076759&r=json, I get a full array.
I want to be able to insert this array into various fields in my database.
What am I doing wrong in getting the data?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community