A Laravel package for the Adapty SDK.

Overview

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

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.

You might also like...
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

List of 77 languages for Laravel Framework 4, 5, 6, 7 and 8, Laravel Jetstream , Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova and Laravel Spark.

Laravel Lang In this repository, you can find the lang files for the Laravel Framework 4/5/6/7/8, Laravel Jetstream , Laravel Fortify, Laravel Cashier

A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.
A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Install Install via composer. $ composer require olliecodes/laravel-etched-blade Once installed you'll want to publish the config. $ php artisan vendo

A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic

A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic! concepts like , Hijri Dates & Arabic strings and so on ..

A Laravel package that adds a simple image functionality to any Laravel model
A Laravel package that adds a simple image functionality to any Laravel model

Laraimage A Laravel package that adds a simple image functionality to any Laravel model Introduction Laraimage served four use cases when using images

laravel-vat is a package that contains the Laravel related wiring code for ibericode/vat

laravel-vat is a package that contains the Laravel related wiring code for ibericode/vat, helping you deal with VAT legislation for businesses based in the EU.

Laravel Backup Panel provides a dashboard for spatie/laravel-backup package.
Laravel Backup Panel provides a dashboard for spatie/laravel-backup package.

Laravel Backup Panel Laravel Backup Panel provides a dashboard for spatie/laravel-backup package. It lets you: create a backup (full | only database |

Laravel package to find performance bottlenecks in your laravel application.
Laravel package to find performance bottlenecks in your laravel application.

Laravel Meter Laravel Meter monitors application performance for different things such as requests, commands, queries, events, etc and presents result

Laravel 2-Step Verification is a package to add 2-Step user authentication to any Laravel project easily.
Laravel 2-Step Verification is a package to add 2-Step user authentication to any Laravel project easily.

Laravel 2-Step verification is a package to add 2-Step user authentication to any Laravel project easily. It is configurable and customizable. It uses notifications to send the user an email with a 4-digit verification code. Laravel 2-Step Authentication Verification for Laravel. Can be used in out the box with Laravel's authentication scaffolding or integrated into other projects.

Releases(1.0.6)
Owner
Melih Berat ŞANLI
aka MBS
Melih Berat ŞANLI
A Laravel Statistics SDK

laravel-statistics shanjing laravel-statistics是一个基于 laravel 开发而成的统计工具,只需很少的代码即可快速构建出一个功能完善的统计模块。开箱即用,对后端开发者非常友好。 功能特性 简洁优雅 API 当缺失对应日期的数据时,自动补充 0 作为默认

青岛山景信息技术有限公司 2 Dec 14, 2022
Video Chat application built using Metered Video SDK, with PHP Laravel Backend and JavaScript Front-End

Group Video Chat App with PHP Laravel and JavaScript Powered by Metered Video SDK Overview This application is a highly scalable group video calling a

null 2 Aug 18, 2022
Easy-to-use SDK for implementing Neshan APIs in your Laravel projects.

Neshan Laravel SDK Easy-to-use SDK for implementing Neshan APIs in your Laravel projects. Install The easiest way to install is by using Composer: com

null 1 Oct 22, 2022
可能是我用过的最优雅的 Alipay 和 WeChat 的支付 SDK 扩展包了

前言 v3 版与 v2 版在底层有很大的不同,基础架构做了重新的设计,更易扩展,使用起来更方便。 开发了多次支付宝与微信支付后,很自然产生一种反感,惰性又来了,想在网上找相关的轮子,可是一直没有找到一款自己觉得逞心如意的,要么使用起来太难理解,要么文件结构太杂乱,只有自己撸起袖子干了。 欢迎 Sta

yansongda 4.5k Jan 6, 2023
Jetstrap is a lightweight laravel 8 package that focuses on the VIEW side of Jetstream / Breeze package installed in your Laravel application

A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel Jetstream and Breeze to Bootstrap 4.

null 686 Dec 28, 2022
A Laravel chat package. You can use this package to create a chat/messaging Laravel application.

Chat Create a Chat application for your multiple Models Table of Contents Click to expand Introduction Installation Usage Adding the ability to partic

Tinashe Musonza 931 Dec 24, 2022
This package provides extended support for our spatie/enum package in Laravel.

Laravel support for spatie/enum This package provides extended support for our spatie/enum package in Laravel. Installation You can install the packag

Spatie 264 Dec 23, 2022
Testbench Component is the de-facto package that has been designed to help you write tests for your Laravel package

Laravel Testing Helper for Packages Development Testbench Component is the de-facto package that has been designed to help you write tests for your La

Orchestra Platform 1.9k Dec 29, 2022
🥳🔐 This package is a Laravel package that checks if an email address is a spammer

This package is a Laravel package that checks if an email address is a spammer. It verifies your signups and form submissions to confirm that they are legitimate.

Endurance, the Martian 15 Dec 19, 2022
GeoLocation-Package - This package helps you to know the current language of the user, the country from which he is browsing, the currency of his country, and also whether he is using it vpn

GeoLocation in PHP (API) ?? ?? ?? This package helps you to know a lot of information about the current user by his ip address ?? ?? ?? This package h

Abdullah Karam 4 Dec 8, 2022