marksihor / laravel-blacklists
Laravel blacklists
Installs: 2 047
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- laravel/framework: ~7.0
This package is auto-updated.
Last update: 2024-10-27 18:42:21 UTC
README
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