I have a view in blade that need a certain data from an api, if i dd the value it will give me a correct value that i need, but if i try to echo the value, then it will popup this error Undefined property: stdClass::$data
this is my code in blade view
@php
$a = new stdClass();
$a = $vehicleController::getDriverName($vehicle->driver_id)->data[0]->name;
echo $a;
@endphp
this is the value if i dd($a) https://i.stack.imgur.com/3v7VM.png
this is the full data https://i.stack.imgur.com/f9Kyu.png