adman9000/laravel-cryptopia

How to use

Closed this issue · 0 comments

For people looking how to use it, here is an example

//On your .env file

CRYPTOPIA_KEY=YOURKEY

CRYPTOPIA_SECRET=YOURSECRET

// In the controller Controller

use adman9000\cryptopia\CryptopiaAPIFacade;

   $cryptopia= new CryptopiaAPI;
    $balances = $cryptopia->getBalances();

    // Send the balance array to the home view.
    return view('home',compact('balances'));

//Consume the balance array in the home view

@foreach ($balances as $balance)
@if($balance['Total']!= '0')

{{$balance['Symbol']}}
{{$balance['Total']}}
{{$balance['Available']}}

@endif
@Endforeach