PHP code example of crypto-technology / laravel-cryptocurrency
1. Go to this page and download the library: Download crypto-technology/laravel-cryptocurrency library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
crypto-technology / laravel-cryptocurrency example snippets
'providers' => [
...
CryptoTech\Laravel\CryptocurrencyServiceProvider::class,
...
],
# boostrap/app.php
// Register the facade
$app->withFacades(true, [
CryptoTech\Laravel\Facades\Cryptocurrency::class => 'Cryptocurrency'
]);
// Load the configuration
$app->configure('cryptocurrency');
// Register the service provider
$app->register(CryptoTech\Laravel\CryptocurrencyServiceProvider::class);
# HomeController.php
use Cryptocurrency;
// Get the Bitcoin object
$bitcoin = Cryptocurrency::get('Bitcoin');
// Return (string) cryptocurrency name
$bitcoin->getName();
// Return (string) cryptocurrency description
$bitcoin->getDescription();
// Return (boolean) cryptocurrency mineable state
$bitcoin->isMineable();
return view('home', compact('bitcoin'));
bash
$ php artisan vendor:publish --provider="CryptoTech\Laravel\CryptocurrencyServiceProvider"