Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/laravel-ready/blacklist-whitelist
- Owner: laravel-ready
- License: mit
- Created: 2023-03-17T14:22:45.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-28T06:39:21.000Z (about 1 year ago)
- Last Synced: 2024-12-06T13:49:04.446Z (about 1 month ago)
- Topics: blacklist, blocklist, laravel, whitelist
- Language: PHP
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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