PHPackages                             gecche/laravel-bannable - 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. gecche/laravel-bannable

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

gecche/laravel-bannable
=======================

A simple package to handle bannable users

v13.0(2mo ago)4917MITPHP

Since Mar 20Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/gecche/laravel-bannable)[ Packagist](https://packagist.org/packages/gecche/laravel-bannable)[ RSS](/packages/gecche-laravel-bannable/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (14)Versions (26)Used By (0)

[![License](https://camo.githubusercontent.com/30597ff9a350144f03bffdd9183e16468e0b3ca1193e1d08591d992622738d55/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://tldrlegal.com/license/mit-license)[![Laravel](https://camo.githubusercontent.com/40236e2476ff414887c1d4654db9142ebac4bce19aac8cd02eb1c6d2762deb09/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31332e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![Laravel](https://camo.githubusercontent.com/3ccc671eca69e8695910518f858e08d1f046a75884b69d4821d3ccfcfee3db83/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31322e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![Laravel](https://camo.githubusercontent.com/7894171e4ea959fd933d11c81799acb9b535d48d90bf7bfbc40edefda04374f7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31312e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![Laravel](https://camo.githubusercontent.com/dc5a02724cce542dca6f1dfd917d7e4dfde8b09e92de6e6a1afe61453eb1c4f4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![Laravel](https://camo.githubusercontent.com/f56ee00d0d7664ddea5ef18ba730624857cb9f9a265075a09582d7beaeb8a6c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d392e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![Laravel](https://camo.githubusercontent.com/8ce0ee8a49efc56b84805856cacdfb6b6dce2a11f7ee9c0b2cf359239298685c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d382e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![Laravel](https://camo.githubusercontent.com/88c14355c6e93c8bf2cb0ae3d78d3934b152943c57124aadbc0fe65e034fb212/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d372e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![Laravel](https://camo.githubusercontent.com/d5aa7cb092b46d050964e450a59e858f65b3d9b1f501bdff0d634f2c79d549ab/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d362e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![Laravel](https://camo.githubusercontent.com/7d48a347cda33127449307a1ba24bdebf76d226c4f2a1585285c8e968f2666a9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)

laravel-bannable
================

[](#laravel-bannable)

Laravel package to handle bannable users

Description
-----------

[](#description)

In many apps, your users could be banned from the platform due to various causes, i.e.: for not respecting platform's rules or for not respecting other users or simply for not paying the monthly fees :)

This package adds a `banned` attribute to the standard users in order to prevent the authentication of such banned users. Fully tested.

Documentation
-------------

[](#documentation)

### Version Compatibility

[](#version-compatibility)

LaravelBannable13.x13.x12.x12.x11.x11.x10.x10.x9.x5.x8.x4.x7.x3.x6.x2.x5.8.x1.4.x5.7.x1.3.x5.6.x1.2.x5.5.x1.1.x### Installation

[](#installation)

Add gecche/laravel-bannable as a requirement to composer.json:

```
{
    "require": {
        "gecche/laravel-bannable": "13.*"
    }
}
```

This package makes use of the discovery feature.

### Basic usage

[](#basic-usage)

To use the package's features, first you have to publish and to run the provided migration which simply adds a `banned` boolean field to the users' table.

Then, if you use Eloquent users you have to add the bannable features to the User model class:

```
php artisan vendor:publish --provider="Gecche\Bannable\BannableServiceProvider"
```

Then, if you use Eloquent users you have to add the bannable features to the User model class:

```
