mberatsanli/laravel-adapty
最新稳定版本:1.0.6
Composer 安装命令:
composer require mberatsanli/laravel-adapty
包简介
Laravel Adapty
README 文档
README
A Laravel package for the Adapty SDK. Please feel free to contribute...
Installation
You can install the package via composer:
composer require mberatsanli/laravel-adapty
You can publish the config file with:
php artisan vendor:publish --tag="adapty-config"
This is the contents of the published config file:
return [ 'base_url' => env('ADAPTY_BASE_URL', 'https://api.adapty.io/api/v1/sdk'), 'secret_token' => env('ADAPTY_SECRET_TOKEN'), // Your adapty secret token. 'webhook' => [ 'path' => env('ADAPTY_WEBHOOK_PATH', '/adapty/webhook'), // webhook endpoint's path 'middleware' => [] // If you want to use middleware on the webhook endpoint, you can adjust that configuration ], ];
Usage
// Create a user $createResponse = \MBS\LaravelAdapty\LaravelAdapty::createUser('<USER ID>'); // Get information about the user $informationResponse = \MBS\LaravelAdapty\LaravelAdapty::userInformation('<USER ID -- OR -- Adapty Profile ID>'); // Set attributes to the user $setAttributesResponse = \MBS\LaravelAdapty\LaravelAdapty::setUserAttributes('<USER ID -- OR -- Adapty Profile ID>', [ // see https://docs.adapty.io/docs/server-side-api-specs#set-the-users-attribute ]); // see https://docs.adapty.io/docs/getting-started-with-server-side-api#case-2-grant-a-subscription $grantRequest = \MBS\LaravelAdapty\Http\Requests\GrantSubscriptionRequest::make(7, ....); $grantResponse = \MBS\LaravelAdapty\LaravelAdapty::grantSubscription('<USER ID -- OR -- Adapty Profile ID>', $grantRequest); // See https://docs.adapty.io/docs/server-side-api-specs#revoke-subscription-from-a-user $revokeSubscriptionResponse = \MBS\LaravelAdapty\LaravelAdapty::revokeSubscription(profileId: '<USER ID -- OR -- Adapty Profile ID>', accessLevel: 'premium', isRefund: <bool>)
Testing
No tests available for now
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please feel free to contributing...
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 1.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-12