Simple blocklist validator.
Install the package via composer:
composer require think.studio/php-blocklist-check
$isAllowlisted = ( new BlocklistProcessor( [
new RegexChecker( [ '/\.hacker$/', ], [ 'email' ] ),
new RegexChecker( [
// contain cyrillic
'/[А-Яа-яЁё]+/u',
], [
'title',
'first_name',
'last_name',
] ),
] ) )->passed( $user )