PHPackages                             qirolab/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. [Database &amp; ORM](/categories/database)
4. /
5. qirolab/laravel-bannable

ActiveLibrary[Database &amp; ORM](/categories/database)

qirolab/laravel-bannable
========================

Laravel bannable package is for blocking and banning Eloquent models.

3.2.0(1y ago)173.0k3MITPHPPHP &gt;=7.3CI passing

Since Jul 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/qirolab/laravel-bannable)[ Packagist](https://packagist.org/packages/qirolab/laravel-bannable)[ Docs](https://qirolab.com)[ Fund](https://www.buymeacoffee.com/qirolab)[ RSS](/packages/qirolab-laravel-bannable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (13)Used By (0)

Laravel Bannable
================

[](#laravel-bannable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1abfd79c426a053ea30f075166806266def4b188c012d86c279052cdf23721ac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7169726f6c61622f6c61726176656c2d62616e6e61626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/qirolab/laravel-bannable)[![GitHub Tests Action Status](https://camo.githubusercontent.com/126619b11e6eb7162c112ec36b42b23134bef00837dbffcbd0cff8477d523de0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7169726f6c61622f6c61726176656c2d62616e6e61626c652f54657374733f6c6162656c3d5465737473)](https://github.com/qirolab/laravel-bannable/actions?query=workflow%3ATests+branch%3Amaster)[![Styling](https://github.com/qirolab/laravel-bannable/workflows/Check%20&%20fix%20styling/badge.svg)](https://github.com/qirolab/laravel-bannable/actions?query=workflow%3A%22Check+%26+fix+styling%22)[![Psalm](https://github.com/qirolab/laravel-bannable/workflows/Psalm/badge.svg)](https://github.com/qirolab/laravel-bannable/actions?query=workflow%3APsalm)[![GitHub](https://camo.githubusercontent.com/6fa18c899e3a12c120c0e96b27e85257172bc72c93d1ba5c66db413a6c70a2c3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7169726f6c61622f6c61726176656c2d62616e6e61626c652e737667)](https://github.com/qirolab/laravel-bannable)

Laravel bannable package for blocking and banning Eloquent models. Using this package any model can be made bannable such as Organizations, Teams, Groups, and others.

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

[](#installation)

Download package into the project using Composer.

```
composer require qirolab/laravel-bannable
```

### Registering package

[](#registering-package)

> Laravel 5.5 (or higher) uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

For Laravel 5.4 or earlier releases version include the service provider within `app/config/app.php`:

```
'providers' => [
    Qirolab\Laravel\Bannable\BannableServiceProvider::class,
],
```

### Prepare Migration

[](#prepare-migration)

Now need to add nullable `banned_at` timestamp column to model. So, create a new migration file.

```
php artisan make:migration add_banned_at_column_to_users_table
```

Add `$table->timestamp('banned_at')->nullable();` in this new migration file as in below example.

```
