PHPackages                             tecmetrix/subscription-system - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tecmetrix/subscription-system

ActiveLibrary[API Development](/categories/api)

tecmetrix/subscription-system
=============================

Laravel subscription system package for multi-company accounting and service management.

v1.0.0(6mo ago)00MITPHP

Since Nov 6Pushed 6mo agoCompare

[ Source](https://github.com/sherazahmad1989/subscription-system)[ Packagist](https://packagist.org/packages/tecmetrix/subscription-system)[ RSS](/packages/tecmetrix-subscription-system/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

💳 Tecmetrix Subscription System
===============================

[](#-tecmetrix-subscription-system)

A flexible **Laravel Subscription Management Package** for multi-company applications.
It allows you to define **services**, create **packages**, and manage **subscriptions** for each company — including subscription duration, start &amp; end dates, and automatic expiration.

---

🚀 Features
----------

[](#-features)

✅ Create and manage services (e.g., Accounting, Payroll, CRM, etc.)
✅ Combine services into packages (Free, Basic, Pro, Enterprise, etc.)
✅ Manage subscriptions for each company
✅ Automatic expiration via Artisan command
✅ Fully configurable and extendable
✅ Built with Laravel best practices

---

🧱 Installation
--------------

[](#-installation)

### Step 1 — Require the Package

[](#step-1--require-the-package)

```
composer require tecmetrix/subscription-system
```

> 💡 If it’s a private repository, add it in your app’s `composer.json`:
>
> ```
> "repositories": [
>   {
>     "type": "vcs",
>     "url": "https://github.com/tecmetrix/subscription-system.git"
>   }
> ]
> ```

---

### Step 2 — Publish &amp; Run Migrations

[](#step-2--publish--run-migrations)

```
php artisan vendor:publish --provider="Tecmetrix\SubscriptionSystem\SubscriptionSystemServiceProvider"
php artisan migrate
```

This will create the following tables:

- `services`
- `packages`
- `package_service`
- `subscriptions`

---

### Step 3 — Add to Your Models (Optional)

[](#step-3--add-to-your-models-optional)

If you have a `Company` model, each company can have one or more subscriptions.

Example:

```
use Tecmetrix\SubscriptionSystem\Models\Subscription;

class Company extends Model
{
    public function subscriptions()
    {
        return $this->hasMany(Subscription::class);
    }
}
```

---

⚙️ Usage
--------

[](#️-usage)

### 🧩 1. Create Services

[](#-1-create-services)

```
use Tecmetrix\SubscriptionSystem\Models\Service;

$service = Service::create([
    'name' => 'CRM Module',
    'description' => 'Manage customers and sales data'
]);
```

---

### 📦 2. Create a Package with Multiple Services

[](#-2-create-a-package-with-multiple-services)

```
use Tecmetrix\SubscriptionSystem\Models\Package;

$package = Package::create([
    'name' => 'Pro Plan',
    'description' => 'Includes CRM and Accounting modules',
    'price' => 49.99,
    'duration_days' => 30, // monthly plan
]);

$package->services()->attach([$service->id]);
```

---

### 🧾 3. Subscribe a Company to a Package

[](#-3-subscribe-a-company-to-a-package)

```
use Tecmetrix\SubscriptionSystem\Models\Subscription;
use Carbon\Carbon;

Subscription::create([
    'company_id' => 1,
    'package_id' => $package->id,
    'start_date' => Carbon::now(),
    'end_date' => Carbon::now()->addDays($package->duration_days),
    'status' => 'active',
]);
```

---

### ⏳ 4. Check Subscription Validity

[](#-4-check-subscription-validity)

```
$subscription = Subscription::where('company_id', 1)->latest()->first();

if ($subscription && $subscription->isActive()) {
    echo "Your subscription is active!";
} else {
    echo "Please renew your subscription.";
}
```

---

### 🕒 5. Auto Expire Old Subscriptions

[](#-5-auto-expire-old-subscriptions)

The package provides a built-in Artisan command:

```
php artisan subscriptions:expire
```

This will mark all expired subscriptions as `expired`.

You can schedule this in `app/Console/Kernel.php`:

```
$schedule->command('subscriptions:expire')->daily();
```

---

🧰 Configuration
---------------

[](#-configuration)

You can publish the config file to customize table names or other settings:

```
php artisan vendor:publish --tag=config
```

---

🧪 Example Workflow
------------------

[](#-example-workflow)

1. Create 3 services: Accounting, CRM, HRM
2. Create 2 packages:
    - **Basic** → includes Accounting
    - **Pro** → includes Accounting + CRM + HRM
3. Subscribe a company to the **Pro** package for 1 year
4. The system automatically expires subscriptions after 365 days

---

🧩 Directory Structure
---------------------

[](#-directory-structure)

```
src/
 ┣━━ Models/
 ┃   ┣━━ Service.php
 ┃   ┣━━ Package.php
 ┃   ┗━━ Subscription.php
 ┣━━ Console/
 ┃   ┗━━ Commands/ExpireSubscriptions.php
 ┣━━ Database/
 ┃   ┗━━ migrations/
 ┣━━ Providers/
 ┃   ┗━━ SubscriptionSystemServiceProvider.php

```

---

🧑‍💻 Artisan Commands
--------------------

[](#‍-artisan-commands)

CommandDescription`php artisan subscriptions:expire`Expires old subscriptions---

🧾 License
---------

[](#-license)

This package is licensed under the **MIT License**.
Copyright (c) 2025 **Tecmetrix**

---

💬 Support
---------

[](#-support)

For issues, suggestions, or contributions:
📧 Email:
🌐 Website:

---

**Developed with ❤️ by Tecmetrix**

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance67

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

194d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b828599e86be8bc9cc5b9caaf01a4cb55af541d311775149377b4ca3837c09b3?d=identicon)[sherazahmad1989](/maintainers/sherazahmad1989)

---

Top Contributors

[![sheeraziqbal](https://avatars.githubusercontent.com/u/124912392?v=4)](https://github.com/sheeraziqbal "sheeraziqbal (1 commits)")

### Embed Badge

![Health badge](/badges/tecmetrix-subscription-system/health.svg)

```
[![Health](https://phpackages.com/badges/tecmetrix-subscription-system/health.svg)](https://phpackages.com/packages/tecmetrix-subscription-system)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
