PHP code example of paladinsdev / php-api

1. Go to this page and download the library: Download paladinsdev/php-api 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/ */

    

paladinsdev / php-api example snippets




use PaladinsDev\PHP\PaladinsAPI;

class  YourClass
{
	public function getSomePlayer()
	{
		$playerDetails =  PaladinsAPI::getInstance('YourDevId', 'YourDevAuthKey', $cacheDriver)->getPlayer('SomePlayer');
	}
}


$app->singleton('PaladinsAPI', function($app) {
	return PaladinsDev\PHP\PaladinsAPI::getInstance(env('PALADINS_DEVID'), env('PALADINS_AUTHKEY'), $cacheDriver);
});





use PaladinsDev\PHP\PaladinsAPI;
 
class YourClass
{
	private $api;

	public function __construct()
	{
		$this->api = new PaladinsAPI('YourDevId', 'YourDevAuthKey', $cacheDriver);
	}

	public function getSomePlayer()
	{
		$playerDetails = $this->api->getPlayer('SomePlayer');
	}
}


use Halfpetal\Onoi\Illuminate\Cache;
use lluminate\Cache\Repository;

$cacheDriver = new Cache(app(Repository::class));