1. Go to this page and download the library: Download gridwb/laravel-adapty 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/ */
gridwb / laravel-adapty example snippets
use Gridwb\LaravelAdapty\Facades\Adapty;
// Get profile by `customer_user_id`
$customerUserId = '<string>';
$response = Adapty::profile()->getProfile(customerUserId: $customerUserId);
// Get profile by `profile_id`
$profileId = '<string>';
$response = Adapty::profile()->getProfile(profileId: $profileId);
echo $response->appId;
echo $response->customerUserId;
echo $response->customerUserId;
// ...
use Gridwb\LaravelAdapty\Facades\Adapty;
// Delete profile by `customer_user_id`
$customerUserId = '<string>';
Adapty::profile()->deleteProfile(customerUserId: $customerUserId);
// Delete profile by `profile_id`
$profileId = '<string>';
Adapty::profile()->deleteProfile(profileId: $profileId);
use Gridwb\LaravelAdapty\Events\SubscriptionStarted;
use Illuminate\Support\Facades\Event;
Event::listen(SubscriptionStarted::class, function (SubscriptionStarted $event) {
$payload = $event->payload;
// Access data from Adapty payload
});