PHPackages                             cr4sec/user-channels - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cr4sec/user-channels

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cr4sec/user-channels
====================

Test task: adding the subscribed channels setting to the user

v1.0.2(5y ago)22MITPHPPHP ^7.0

Since Sep 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/crysecurity/user-channels)[ Packagist](https://packagist.org/packages/cr4sec/user-channels)[ RSS](/packages/cr4sec-user-channels/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Associate users with channels
=============================

[](#associate-users-with-channels)

[![Total Downloads](https://camo.githubusercontent.com/385a2d6e503cffe8bcb95b42bc966731ba6f523e3d4fb939b9340f9749364200/68747470733a2f2f706f7365722e707567782e6f72672f6372347365632f757365722d6368616e6e656c732f646f776e6c6f616473)](//packagist.org/packages/cr4sec/user-channels)[![Version](https://camo.githubusercontent.com/4133e403484a7b0574baf3a238b3bb4b26c7e0cd67778eb8d1f2d606ccce9307/68747470733a2f2f706f7365722e707567782e6f72672f6372347365632f757365722d6368616e6e656c732f76657273696f6e)](//packagist.org/packages/cr4sec/user-channels)[![Dependents](https://camo.githubusercontent.com/4de245be19315902a09d8ee14eae80a3fe8b9a9d078356a2f77701ea777e376e/68747470733a2f2f706f7365722e707567782e6f72672f6372347365632f757365722d6368616e6e656c732f646570656e64656e7473)](//packagist.org/packages/cr4sec/user-channels)[![License](https://camo.githubusercontent.com/d20df381279c6f84f85d3da2faad2e03563033d3d8396c06bfced156bc474f63/68747470733a2f2f706f7365722e707567782e6f72672f6372347365632f757365722d6368616e6e656c732f6c6963656e7365)](//packagist.org/packages/cr4sec/user-channels)

This is a test project for working with creating your own package for Laravel

Installation in Laravel
-----------------------

[](#installation-in-laravel)

- This package can be used with Laravel 5.8 or higher.
- This package publishes a config/cr4sec/channels.php file.
- You can install the package via composer:

```
$ composer require cr4sec/user-channels
```

- Optional: The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:

```
'providers' => [
    // ...
    Cr4Sec\UserChannels\ChannelsServiceProvider::class,
];
```

- You should publish the migration, component and the channels.php config file with:

```
$ php artisan vendor:publish --provider="Cr4Sec\UserChannels\ChannelsServiceProvider"
```

- You should publish the migration and the config/cr4sec/channels.php config file with:

```
$ php artisan migrate
```

- Add the "HasChannels" trait to your User model.

```
class User extends Authenticatable
{
    // ...
    use Cr4Sec\UserChannels\Traits\HasChannels;
```

Usage
-----

[](#usage)

Get user channels

```
$user->channels;
```

User's subscription to channels

```
$user->attachChannel(['afgt6d3', 'a54dhyt']);
$user->attachChannel('afg7');
$user->attachChannel(Channel::first);
```

User's unsubscription to channels

```
$user->channels()->detach(['afgt6d3', 'a54dhyt']);
```

Blade component

```

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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

Every ~0 days

Total

3

Last Release

2079d ago

### Community

Maintainers

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

---

Top Contributors

[![crysecurity](https://avatars.githubusercontent.com/u/61580789?v=4)](https://github.com/crysecurity "crysecurity (8 commits)")

---

Tags

laravelphp

### Embed Badge

![Health badge](/badges/cr4sec-user-channels/health.svg)

```
[![Health](https://phpackages.com/badges/cr4sec-user-channels/health.svg)](https://phpackages.com/packages/cr4sec-user-channels)
```

###  Alternatives

[yajra/laravel-datatables-oracle

jQuery DataTables API for Laravel

4.9k33.8M339](/packages/yajra-laravel-datatables-oracle)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[spatie/laravel-dashboard

A dashboard for Laravel

568156.1k94](/packages/spatie-laravel-dashboard)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[illuminatech/balance

Provides support for Balance accounting system based on debit and credit principle

16137.4k](/packages/illuminatech-balance)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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