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

AbandonedArchivedLibrary

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

Laravel 5 user block system

1.0.0(8y 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 2d 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 59% 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

3271d 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

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[cybercog/laravel-ban

Laravel Ban simplify blocking and banning Eloquent models.

1.1k651.8k11](/packages/cybercog-laravel-ban)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)[masterro/laravel-mail-viewer

Easily view in browser outgoing emails.

6392.1k](/packages/masterro-laravel-mail-viewer)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)

PHPackages © 2026

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