Skip to content

Commit b50b360

Browse files
committed
beta version
1 parent b39df03 commit b50b360

File tree

4 files changed

+125
-0
lines changed

4 files changed

+125
-0
lines changed

composer.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "iexbase/tron-api-laravel",
3+
"description": "Laravel package, PHP API for interacting with Tron (Trx)",
4+
"license": "MIT",
5+
"type": "library",
6+
"homepage": "https://github.com/iexbase/tron-api-laravel",
7+
"authors": [
8+
{
9+
"name": "Shamsudin Serderov",
10+
"email": "[email protected]"
11+
}
12+
],
13+
"require": {
14+
"php": "^7.1",
15+
"iexbase/tron-api": "^3.0",
16+
"illuminate/support": "^7.0|^8.0"
17+
},
18+
19+
"require-dev": {
20+
"orchestra/testbench": "^6.1",
21+
"phpunit/phpunit": "^9.3"
22+
},
23+
24+
"autoload": {
25+
"psr-4": {
26+
"IEXBase\\TronAPI\\Laravel\\": "src/"
27+
}
28+
},
29+
30+
"autoload-dev": {
31+
"psr-4": {
32+
"IEXBase\\TronAPI\\Laravel\\Tests\\": "tests/"
33+
}
34+
},
35+
36+
"extra": {
37+
"laravel": {
38+
"providers": [
39+
"IEXBase\\TronAPI\\Laravel\\TronServiceProvider"
40+
],
41+
"aliases": {
42+
"TronAPI": "IEXBase\\TronAPI\\Laravel\\Facades\\TronAPI"
43+
}
44+
}
45+
},
46+
47+
"config": {
48+
"sort-packages": true
49+
},
50+
51+
"minimum-stability": "dev",
52+
"prefer-stable": true
53+
}

config/tron-api.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
return [
3+
4+
];

src/Facades/TronAPI.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
namespace IEXBase\TronAPI\Laravel\Facades;
3+
4+
use Illuminate\Support\Facades\Facade;
5+
6+
/**
7+
* Class TronAPI.
8+
*/
9+
class TronAPI extends Facade
10+
{
11+
/**
12+
* Get the registered name of the component.
13+
*
14+
* @return string
15+
*/
16+
protected static function getFacadeAccessor()
17+
{
18+
return 'tron-api';
19+
}
20+
}

src/TronServiceProvider.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
namespace IEXBase\TronAPI\Laravel;
3+
4+
5+
use IEXBase\TronAPI\Tron;
6+
use Illuminate\Support\ServiceProvider;
7+
8+
class TronServiceProvider extends ServiceProvider
9+
{
10+
11+
/**
12+
* Indicates if loading of the provider is deferred.
13+
*
14+
* @var bool
15+
*/
16+
protected $defer = true;
17+
18+
/**
19+
* Bootstrap the application services.
20+
*
21+
* @return void
22+
*/
23+
public function register()
24+
{
25+
$this->configure();
26+
$this->app->bind('tron-api', function ($app) {
27+
return new Tron();
28+
});
29+
}
30+
31+
/**
32+
* Setup the configuration.
33+
*/
34+
protected function configure()
35+
{
36+
$this->mergeConfigFrom(__DIR__.'/../config/tron-api.php', 'tron-api');
37+
}
38+
39+
/**
40+
* Get the services provided by the provider.
41+
*
42+
* @return array
43+
*/
44+
public function provides()
45+
{
46+
return ['tron-api'];
47+
}
48+
}

0 commit comments

Comments
 (0)