Search by

itmosoft / laravel-subscriptions

adeelrao007

Plan and subscription lifecycle management for Laravel applications.

Package info

github.com/ITMOSOFT/laravel-subscriptions

pkg:composer/itmosoft/laravel-subscriptions

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-11-07 03:30 UTC

This package is auto-updated.

Last update: 2026-11-07 03:32:26 UTC


README

Gateway-agnostic subscription lifecycle primitives for Laravel 12 and 13.

Features

  • Subscription plans with amount (integer minor units), currency, interval and interval count.
  • Polymorphic subscribers.
  • Trial, active, paused and cancelled states.
  • Start, renew, pause, resume and immediate cancellation operations.
  • Status history and configurable database table prefix.
  • Renewal does not collect payment; no gateway API is called.

Install

composer require itmosoft/laravel-subscriptions
php artisan vendor:publish --tag=subscriptions-config
php artisan vendor:publish --tag=subscriptions-migrations
php artisan migrate

Use

use ItmoSoft\Subscriptions\Models\SubscriptionPlan;
use ItmoSoft\Subscriptions\Services\SubscriptionManager;

$plan = SubscriptionPlan::create([
    'name' => 'Pro Monthly', 'slug' => 'pro-monthly',
    'amount' => 2900, 'currency' => 'USD',
    'interval' => 'month', 'interval_count' => 1, 'is_active' => true,
]);
$subscription = app(SubscriptionManager::class)->start($user, $plan, now()->addDays(14));

Renew only after the integrating application confirms successful payment. Schedule renewal work in the host application and use distributed locking plus gateway idempotency. v1.0.0 cancellation is immediate; no proration, grace periods, metered billing, dunning, tax or payment collection is included.

Test

composer install
composer test

GitHub Actions runs composer test for Laravel 12 and 13; failed PHPUnit tests fail the job.