think.studio/laravel-blocklist-check
最新稳定版本:2.1.0
Composer 安装命令:
composer require think.studio/laravel-blocklist-check
包简介
Simple blocklist validator for laravel.
README 文档
README
Add model to blocklist/allowlist,
Installation
Install the package via composer:
composer require think.studio/laravel-blocklist-check
Optionally you can publish the config file with:
php artisan vendor:publish --provider="LaraBlockList\ServiceProvider" --tag="config"
Usage
Update your model:
use LaraBlockList\Contracts\CanBeInBlocklist; use LaraBlockList\Models\HasBlocklist; class User /* ... */ implements CanBeInBlocklist { use HasBlocklist; /** * @inheritDoc */ public function getBlocklistProcessor(array $args = []): BlocklistProcessor { return new BlocklistProcessor([ new RegexChecker([ '/\.ru$/', ], [ 'email' ]), new RegexChecker([ /* contain cyrillic */ '/[А-Яа-яЁё]+/u', ], [ 'name', ]), ]); } // ... }
Now you can run checks:
php artisan blocklist:check "\App\Models\User" # or php artisan blocklist:check "\App\Models\User" 123 # or php artisan blocklist:check "\App\Models\User" --from=2020-01-01 --queue=default
Credits
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-19