laravel-ready / blacklist-whitelist
Simple domain and email blacklist/whitelist package
1.0.0
2023-03-26 03:56 UTC
Requires
- php: ^8.1 || ^8.0
- illuminate/support: ^10.0 || ^9.0
Requires (Dev)
- mockery/mockery: ^1.5
- nunomaduro/larastan: ^2.5
- orchestra/testbench: ^8.0
- pestphp/pest: ^1.22
- pestphp/pest-plugin-laravel: ^1.4
- pestphp/pest-plugin-parallel: ^1.2
- phpstan/extension-installer: ^1.2
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
README
📂 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.