PHPackages                             hareku/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. hareku/laravel-user-blockable

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

hareku/laravel-user-blockable
=============================

Laravel 5 user block system

1.0.0(9y ago)5456[1 PRs](https://github.com/hareku/laravel-user-blockable/pulls)MITPHPPHP &gt;=7.0

Since May 30Pushed 8y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (3)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 hareku/laravel-user-blockable`

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

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

Publish the config file. (blockable.php)

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

Finally, use Blockable trait in User model.

```
use Hareku\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

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

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

Unknown

Total

1

Last Release

3318d ago

### Community

Maintainers

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

---

Top Contributors

[![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/hareku-laravel-user-blockable/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2013.2k](/packages/alajusticia-laravel-logins)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6783.6k5](/packages/hasinhayder-tyro)[offload-project/laravel-invite-only

A Laravel package for managing user invitations with polymorphic relationships, token-based access, scheduled reminders, and event-driven notifications.

729.3k2](/packages/offload-project-laravel-invite-only)[masterix21/laravel-licensing

Laravel licensing package with polymorphic assignment to any model, activation keys, expirations/renewals, and seat control via LicenseUsage. Supports offline verification with public-key–signed tokens, a CLI to generate/rotate/revoke keys, and an extensible architecture via config and contracts.

1542.1k4](/packages/masterix21-laravel-licensing)[outerweb/image-library

Store and link files to your models

1113.8k3](/packages/outerweb-image-library)

PHPackages © 2026

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