PHPackages                             probablyrational/laravel-user-blockable - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. probablyrational/laravel-user-blockable

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

probablyrational/laravel-user-blockable
=======================================

Laravel 5 user block system

1.1.1(5y ago)0370MITPHPPHP &gt;=7.0

Since May 30Pushed 5y agoCompare

[ Source](https://github.com/ProbablyRational/laravel-user-blockable)[ Packagist](https://packagist.org/packages/probablyrational/laravel-user-blockable)[ RSS](/packages/probablyrational-laravel-user-blockable/feed)WikiDiscussions master Synced 4w ago

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

Laravel 5 User Block System
===========================

[](#laravel-5-user-block-system)

This package helps you to add user block system to your project.

- So simply and easy.
- Use "ON DELETE CASCADE" in block relationships table.

Caution
-------

[](#caution)

- *Support Laravel 5.4~*
- *Required php &gt;=7.0*

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

[](#installation)

First, pull in the package through Composer.

Run `composer require probablyrational/laravel-user-blockable`

And then, include the service provider within `config/app.php`.

```
'providers' => [
    ProbablyRational\LaravelBlockable\BlockableServiceProvider::class,
];
```

Publish the config file. (blockable.php)

```
$ php artisan vendor:publish --provider="ProbablyRational\LaravelBlockable\BlockableServiceProvider"
```

Finally, use Blockable trait in User model.

```
use ProbablyRational\LaravelBlockable\Traits\Blockable;

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

Usage
-----

[](#usage)

### Block a user or users

[](#block-a-user-or-users)

```
$user->block(1);
$user->block([1,2,3,4]);
```

### Add blockers

[](#add-blockers)

```
$user->addBlockers(1);
$user->addBlockers([1,2,3,4]);
```

### Unblock a user or users

[](#unblock-a-user-or-users)

```
$user->unblock(1);
$user->unblock([1,2,3,4]);
```

### Get blocker users / blocked by users

[](#get-blocker-users--blocked-by-users)

```
// blocker users
$user->blockerUsers()->get(); // Get blocker user models.
$user->blockerRelationships()->get(); // Get blocker relationship models.

// blocked by users
$user->blockingUsers()->get();
$user->blockingRelationships()->get();
```

### Check if it is blocking

[](#check-if-it-is-blocking)

```
$user->isBlocking(1);
$user->isBlocking([1,2,3,4]);
```

### Check if it is being blocked

[](#check-if-it-is-being-blocked)

```
$user->isBlockedBy(1);
$user->isBlockedBy([1,2,3,4]);
```

### Check if it is mutual block

[](#check-if-it-is-mutual-block)

```
$user->isMutualBlock(1);
$user->isMutualBlock([1,2,3,4]);
```

### Get blocker/blocked IDs

[](#get-blockerblocked-ids)

```
$user->block([1,2,3]);

$user->blockerIds(); // [1,2,3]
$user->blockingIds();
```

### Reject user ids

[](#reject-user-ids)

```
$user->blockerUsers()->pluck('id')->all(); // [1,2,3]
$user->rejectNotBlocker([1,2,3,4,5]); // [1,2,3]
```

```
$user->block([1,2,3]);
$user->rejectNotBlocking([1,2,3,4,5]); // [1,2,3]
```

License
-------

[](#license)

MIT

Author
------

[](#author)

hareku ()

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% 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 ~625 days

Total

3

Last Release

2017d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/10c7ae0cae2e0d9af73bec18987dc295197263f59df700e220b795e40a90907d?d=identicon)[ProbablyRational](/maintainers/ProbablyRational)

---

Top Contributors

[![hcaz](https://avatars.githubusercontent.com/u/2422207?v=4)](https://github.com/hcaz "hcaz (8 commits)")[![hareku](https://avatars.githubusercontent.com/u/17667652?v=4)](https://github.com/hareku "hareku (1 commits)")

---

Tags

laravelblock

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/probablyrational-laravel-user-blockable/health.svg)

```
[![Health](https://phpackages.com/badges/probablyrational-laravel-user-blockable/health.svg)](https://phpackages.com/packages/probablyrational-laravel-user-blockable)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M344](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M52](/packages/php-open-source-saver-jwt-auth)[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

339785.3k8](/packages/laragear-two-factor)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[corbosman/laravel-passport-claims

Add claims to Laravel Passport JWT Tokens

88655.9k](/packages/corbosman-laravel-passport-claims)[yajra/laravel-acl

Laravel ACL is a simple role, permission ACL for Laravel Framework.

112103.9k1](/packages/yajra-laravel-acl)

PHPackages © 2026

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