i have json code in Laravel, how to parse in view blade?
my code :
$latitude1 = -7.325374900000001;
$longitude1 = 108.2251681;
$latitude2 = -7.331842799999999;
$longitude2 = 108.2237382;
$dataJson = file_get_contents("https://maps.googleapis.com/maps/api/distancematrix/json?units=metric&origins=".$latitude1.",".$longitude1."&destinations=".$latitude2.",".$longitude2."&key=".key);
$data = json_decode($dataJson,true);
$nilaiJarak = $data['rows'][1]['elements'][1]['distance']['text'];
return view('maps', compact('maps','nilaiJarak'));
i want to only get distance on laravel view blade.