Im using an API, and I need to display the data in my blade view. Im having trouble doing that. This is what I have in my controller:
public function index() {
// secret ....
// key....
$configuration = Configuration::apiKey($apiKey, $apiSecret);
$client = Client::create($configuration);
$BTCSellPrice = $client->getSellPrice('BTC-USD');
dd($BTCSellPrice);
return view('welcome', compact(
'BTCSellPrice'
));
}
Its not working,
I tried calling it in the front-end these ways:
{{ $BTCSellPrice }}
{{ $BTCSellPrice->amount }}
{{ $BTCSellPrice['amount'] }}
{{ $BTCSellPrice[0] }}
But keep on getting errors, like:
Cannot use object of type Coinbase\Wallet\Value\Money as array
How to do it?