Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/laravel-ready/blacklist-whitelist

Blacklist/Whitelist for Laravel apps
https://github.com/laravel-ready/blacklist-whitelist

blacklist blocklist laravel whitelist

Last synced: 25 days ago
JSON representation

Blacklist/Whitelist for Laravel apps

Awesome Lists containing this project

README

        

# BlacklistWhitelist

[![BlacklistWhitelist](https://preview.dragon-code.pro/LaravelReady/blacklist-whitelist.svg?brand=laravel)](https://github.com/laravel-ready/blacklist-whitelist)

[![Stable Version][badge_stable]][link_packagist]
[![Unstable Version][badge_unstable]][link_packagist]
[![Total Downloads][badge_downloads]][link_packagist]
[![License][badge_license]][link_license]

## 📂 About
Simple domain and email blacklist/whitelist package...

## 📦 Installation

Get via composer

```bash
composer require laravel-ready/blacklist-whitelist
```

## ⚙️ Configs

```bash
php artisan vendor:publish --tag=blacklist-whitelist-config
```
## Migrations

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

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

## 📝 Usage

```php
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');
```

## ⚓ Credits

- This project was generated by the **[packager](https://github.com/laravel-ready/packager)**.

[badge_downloads]: https://img.shields.io/packagist/dt/laravel-ready/blacklist-whitelist.svg?style=flat-square

[badge_license]: https://img.shields.io/packagist/l/laravel-ready/blacklist-whitelist.svg?style=flat-square

[badge_stable]: https://img.shields.io/github/v/release/laravel-ready/blacklist-whitelist?label=stable&style=flat-square

[badge_unstable]: https://img.shields.io/badge/unstable-dev--main-orange?style=flat-square

[link_license]: LICENSE

[link_packagist]: https://packagist.org/packages/laravel-ready/blacklist-whitelist