I want to open a JSON from url in php/laravel file. this is my code :
{{ini_set("allow_url_fopen", 1)}}
{{$id_ = $blog_post->featured_media}}
{{$url_ = 'http://example.net/blog/wp-json/wp/v2/media/'.$id_}}
{{$data = @file_get_contents($url_)}}
{{$json = @json_decode($data, true)}}
{{var_dump(@$json)}}
when i try reload page i get this error :
something went wrong
how can i read JSON from url ?
@php ... @endphpto use "regular" PHP code in your view