laravel-ready/blacklist-whitelist

Simple domain and email blacklist/whitelist package

1.0.0 2023-03-26 03:56 UTC

This package is auto-updated.

Last update: 2024-11-28 09:21:49 UTC


README

BlacklistWhitelist

Stable Version Unstable Version Total Downloads License

📂 About

Simple domain and email blacklist/whitelist package...

📦 Installation

Get via composer

composer require laravel-ready/blacklist-whitelist

⚙️ Configs

php artisan vendor:publish --tag=blacklist-whitelist-config

Migrations

# publish migrations
php artisan vendor:publish --tag=blacklist-whitelist-migrations

# apply migrations
php artisan migrate --path=/database/migrations/laravel-ready/blacklist-whitelist

📝 Usage

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@example.com', BlockType::Blacklist);

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

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

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

⚓ Credits

  • This project was generated by the packager.