Package Data | |
---|---|
Maintainer Username: | nguyenphuocnhatthanh |
Maintainer Contact: | nguyenphuocnhatthanh@gmail.com (ThanhNguyen) |
Package Create Date: | 2016-10-26 |
Package Last Update: | 2016-12-05 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-15 03:04:16 |
Package Statistics | |
---|---|
Total Downloads: | 612 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
#Connect Platform for BAP Service
Add the following line to composer.json file and run composer update
{
"require": {
"bap/connect": "1.*"
}
}
Or install with CLI:
composer require bap/connect
Open up config/app.php
and add the following to the provires
key.
Bap\ConnectPlatform\ConnectPlatformServiceProvide::class
You can register the ConnectPlatform Facade aliases
key with:
'ConnectPlatform' => Bap\ConnectPlatform\ConnectPlatformFacade::class
You'll need to publish all vendor assets:
php artisan vendor:publish --provider="Bap\ConnectPlatform\ConnectPlatformServiceProvide"
And also run migrations
php artisan migrate
And add PLATFORM_URL
to .env
PLATFORM_URL=my_url
PLATFORM_GRANT=grant
PLATFORM_CLIENT_ID=CLIENT_ID
PLATFORM_CLIENT_SECRET=CLIENT_SECRET
PLATFORM_SCOPE=SCOPE
...
use Bap\ConnectPlatform\Traits\WithDevices;
use Bap\ConnectPlatform\Contracts\WithDevicesInterface;
class User extends Model implements AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract,
WithDevicesInterface
{
use Authenticatable,
Authorizable,
CanResetPassword,
RelationDevices;
construsctor
method Controller: public function __constructor()
{
$this->middleware('jwt.auth');
}
Route::post('me', ['before' => 'jwt-auth', function() {
// Todo
}]);
device
to options claims for jwtGet user profile from Platform with options $attributes = ['id', 'username', 'telephone']
<?php
use ConnectPlatform;
ConnectPlatform::profile(array $attributes);
OR
<?php
app('platform')->profile(array $attribuites);
ConnectPlatform::getFriends($uid);
ConnectPlatform::getBlockFriends($uid);
ConnectPlatform::getListIdFriendWaiting($uid);
ConnectPlatform::getListIdFriendRequest($uid);
ConnectPlatform::getRelation($uid, $friendUID)
ConnectPlatform::isFriends($uid, array $uids)
ConnectPlatform::checkListFriends($uid, array $uids)
ConnectPlatform::sendFriendRequest($uid, $friendUid);
ConnectPlatform::approveFriendRequest($uid, $friendUid);
$uids
is list USER ID
of platformConnectPlatform::searchTelephone($uid, array $params);
$params = ['phone_code' => '', 'telephone' => '']
ConnectPlatform::getCoin($uid);
ConnectPlatform::getHistoryCoin($uid, $action);
With $action in array ['request', 'payment', 'withdraw']
ConnectPlatform::exchange($uid, $action, array $params);
With $action in array ['money_coin', 'coin_money']
and $params = ['src' => '' , 'des' => '']
ConnectPlatform::requestCoin($uid, $coin);
ConnectPlatform::withDrawMoney($uid, $money);
ConnectPlatform::getPaymentToken($uid);
ConnectPlatform::requestPayment($uid, array $params);
With $params = ['item_id' => '' , 'item_cat_id' => '', 'item_value' => '', 'token' => '']
#####With $uid
is ID
of platform
#Config file You can change model, list devices, timeout request at config file.