PHP code example of laravel-ready / blacklist-whitelist

1. Go to this page and download the library: Download laravel-ready/blacklist-whitelist 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/ */

    

laravel-ready / blacklist-whitelist example snippets


use LaravelReady\BlacklistWhitelist\Enums\BlockType;
use LaravelReady\BlacklistWhitelist\BlacklistWhitelist;

// add domain to blacklist or whitelist
BlacklistWhitelist::subject('example.com', BlockType::Blacklist);
BlacklistWhitelist::subject('example.com', BlockType::Whitelist);

// email example
BlacklistWhitelist::subject('[email protected]', BlockType::Blacklist);

// any subject
BlacklistWhitelist::subject('TEST', BlockType::Blacklist);

// check subject
BlacklistWhitelist::isBlocked('example.com');

// check allowed subject
BlacklistWhitelist::isAllowed('example.com');
bash
php artisan vendor:publish --tag=blacklist-whitelist-config