Looking to hire Laravel developers? Try LaraJobs

laravel-blacklists maintained by marksihor

Description
Laravel blacklists
Author
Last update
2020/05/27 10:57 (dev-master)
License
Links
Downloads
2 048

Comments
comments powered by Disqus

laravel-blacklists

The package allows you to make blacklists with specified types and values.

Installing

$ composer require marksihor/laravel-blacklists -vvv

Usage

Use trait in Model you wish to use blacklist on

<?php

namespace App;

use MarksIhor\LaravelBlacklists\Blacklistable;

class User extends Authenticatable implements MustVerifyEmail
{
    use Blacklistable;
    <...>
}

Usage examples

$user->addToBlacklist('user', 7); // add to blacklist
$user->removeFromBlacklist('user', 5); // remove from blacklist
$user->checkIfInBlacklist('user', 5); // check if in blacklist
$user->getBlacklists(); // view all blacklists

The package uses Cache facade to cache all queries.

License

MIT