PHPackages                             zing/laravel-subscribe - 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. [Payment Processing](/categories/payments)
4. /
5. zing/laravel-subscribe

Abandoned → [laravel-interaction/subscribe](/?search=laravel-interaction%2Fsubscribe)Library[Payment Processing](/categories/payments)

zing/laravel-subscribe
======================

User subscribe/unsubscribe behaviour for Laravel.

3.5.0(3mo ago)8168MITPHPPHP ^8.0CI failing

Since Nov 22Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/laravel-interaction/subscribe)[ Packagist](https://packagist.org/packages/zing/laravel-subscribe)[ Docs](https://github.com/laravel-interaction/subscribe)[ RSS](/packages/zing-laravel-subscribe/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (12)Versions (36)Used By (0)

Laravel Subscribe
=================

[](#laravel-subscribe)

User subscribe/unsubscribe behaviour for Laravel.

[![Latest Stable Version](https://camo.githubusercontent.com/82819af58ab75d61fcab5f3caa06e95523adf14c6018534d2028bca0116f31b2/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d696e746572616374696f6e2f7375627363726962652f762f737461626c652e737667)](https://packagist.org/packages/laravel-interaction/subscribe)[![Total Downloads](https://camo.githubusercontent.com/537b574c533070126a480c0a285629ce193080ff816adf0f162ee0bcf44b88ff/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d696e746572616374696f6e2f7375627363726962652f646f776e6c6f616473)](https://packagist.org/packages/laravel-interaction/subscribe)[![Latest Unstable Version](https://camo.githubusercontent.com/48a6321601ae2c36908b19fa4cf5658e3322349d07bee70db02954b9234459b4/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d696e746572616374696f6e2f7375627363726962652f762f756e737461626c652e737667)](https://packagist.org/packages/laravel-interaction/subscribe)[![License](https://camo.githubusercontent.com/74ea6e1fe54a7071d52665d9b8540fce56cfac5c330bce46610a68fb96f926e7/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d696e746572616374696f6e2f7375627363726962652f6c6963656e7365)](https://packagist.org/packages/laravel-interaction/subscribe)

Introduction
------------

[](#introduction)

It used for users to subscribe to the model(user/topic/channel) in order to receive notifications.

[![](https://camo.githubusercontent.com/e15488c00f0390fa7daa5cab72d9d91acc4ccf7930abaec268dcff315a416cc6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2546302539462539342539342d312e326b2d677265656e3f7374796c653d736f6369616c)](https://camo.githubusercontent.com/e15488c00f0390fa7daa5cab72d9d91acc4ccf7930abaec268dcff315a416cc6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2546302539462539342539342d312e326b2d677265656e3f7374796c653d736f6369616c)

Installation
------------

[](#installation)

### Requirements

[](#requirements)

- [PHP 8.0+](https://php.net/releases/)
- [Composer](https://getcomposer.org)
- [Laravel 8.0+](https://laravel.com/docs/releases)

### Instructions

[](#instructions)

Require Laravel Subscribe using [Composer](https://getcomposer.org).

```
composer require laravel-interaction/subscribe
```

Publish configuration and migrations

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

Run database migrations.

```
php artisan migrate
```

Usage
-----

[](#usage)

### Setup Subscriber

[](#setup-subscriber)

```
use Illuminate\Database\Eloquent\Model;
use LaravelInteraction\Subscribe\Concerns\Subscriber;

class User extends Model
{
    use Subscriber;
}
```

### Setup Subscribable

[](#setup-subscribable)

```
use Illuminate\Database\Eloquent\Model;
use LaravelInteraction\Subscribe\Concerns\Subscribable;

class Channel extends Model
{
    use Subscribable;
}
```

### Subscriber

[](#subscriber)

```
use LaravelInteraction\Subscribe\Tests\Models\Channel;
/** @var \LaravelInteraction\Subscribe\Tests\Models\User $user */
/** @var \LaravelInteraction\Subscribe\Tests\Models\Channel $channel */
// Subscribe to Subscribable
$user->subscribe($channel);
$user->unsubscribe($channel);
$user->toggleSubscribe($channel);

// Compare Subscribable
$user->hasSubscribed($channel);
$user->hasNotSubscribed($channel);

// Get subscribed info
$user->subscriberSubscriptions()->count();

// with type
$user->subscriberSubscriptions()->withType(Channel::class)->count();

// get subscribed channels
Channel::query()->whereSubscribedBy($user)->get();

// get subscribed channels doesnt subscribed
Channel::query()->whereNotSubscribedBy($user)->get();
```

### Subscribable

[](#subscribable)

```
use LaravelInteraction\Subscribe\Tests\Models\User;
use LaravelInteraction\Subscribe\Tests\Models\Channel;
/** @var \LaravelInteraction\Subscribe\Tests\Models\User $user */
/** @var \LaravelInteraction\Subscribe\Tests\Models\Channel $channel */
// Compare Subscriber
$channel->isSubscribedBy($user);
$channel->isNotSubscribedBy($user);
// Get subscribers info
$channel->subscribers->each(function (User $user){
    echo $user->getKey();
});

$channels = Channel::query()->withCount('subscribers')->get();
$channels->each(function (Channel $channel){
    echo $channel->subscribers()->count(); // 1100
    echo $channel->subscribers_count; // "1100"
    echo $channel->subscribersCount(); // 1100
    echo $channel->subscribersCountForHumans(); // "1.1K"
});
```

### Events

[](#events)

EventFired`LaravelInteraction\Subscribe\Events\Subscribed`When an object get subscribed.`LaravelInteraction\Subscribe\Events\Unsubscribed`When an object get unsubscribed.License
-------

[](#license)

Laravel Subscribe is an open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance80

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% 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

Every ~57 days

Recently: every ~274 days

Total

35

Last Release

107d ago

Major Versions

0.6.1 → 1.0.0-alpha.12021-08-28

1.x-dev → 2.0.0-beta.12022-03-10

2.x-dev → 3.0.02022-11-27

PHP version history (3 changes)0.0.1PHP ^7.2 || ^8.0

2.0.0-beta.1PHP ^7.3 || ^8.0

3.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fafa5bffa28dcd722432b244bf3f0bfe773406df29fea295847e2397b95d50b?d=identicon)[zingimmick](/maintainers/zingimmick)

---

Top Contributors

[![zingimmick](https://avatars.githubusercontent.com/u/26657141?v=4)](https://github.com/zingimmick "zingimmick (102 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![kodiakhq[bot]](https://avatars.githubusercontent.com/in/29196?v=4)](https://github.com/kodiakhq[bot] "kodiakhq[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

laravelsubscribesubscriptionlaravelsubscriptionsubscribe

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zing-laravel-subscribe/health.svg)

```
[![Health](https://phpackages.com/badges/zing-laravel-subscribe/health.svg)](https://phpackages.com/packages/zing-laravel-subscribe)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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