1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 23:22:52 +01:00
invoiceninja/app/Http/ValidationRules/Account/EmailBlackListRule.php
2023-12-26 13:54:27 +11:00

37 lines
843 B
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Http\ValidationRules\Account;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
/**
* Class EmailBlackListRule.
*/
class EmailBlackListRule implements ValidationRule
{
public array $blacklist = [
'noddy@invoiceninja.com',
];
public function validate(string $attribute, mixed $value, Closure $fail): void
{
if (in_array($value, $this->blacklist)) {
$fail('This email address is blacklisted, if you think this is in error, please email contact@invoiceninja.com');
}
}
}