PHP Classes


Recommend this page to a friend!
  Classes of Melih Berat SANLI   Laravel Adapty   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Laravel Adapty
Help implement in-app purchases using Adapty
Author: By
Last change:
Date: 4 months ago
Size: 3,146 bytes


Class file image Download

Laravel Adapty

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Laravel package for the Adapty SDK. Please feel free to contribute...


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', ''),

    '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


// 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

// see
$grantRequest = \MBS\LaravelAdapty\Requests\GrantSubscriptionRequest::make(7, ....);
$grantResponse = \MBS\LaravelAdapty\LaravelAdapty::grantSubscription('<USER ID -- OR -- Adapty Profile ID>', $grantRequest);

// See
$revokeSubscriptionResponse = \MBS\LaravelAdapty\LaravelAdapty::revokeSubscription(profileId: '<USER ID -- OR -- Adapty Profile ID>', accessLevel: 'premium', isRefund: <bool>)


No tests available for now

composer test


Please see CHANGELOG for more information on what has changed recently.


Please feel free to contributing...



The MIT License (MIT). Please see License File for more information.