PHP code example of marksihor / laravel-blacklists

1. Go to this page and download the library: Download marksihor/laravel-blacklists library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

marksihor / laravel-blacklists example snippets




namespace App;

use MarksIhor\LaravelBlacklists\Blacklistable;

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

$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