%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/loslex_o/demo/app/Rules/
Upload File :
Create Path :
Current File : /www/loslex_o/demo/app/Rules/ForbiddenUsernames.php

<?php

namespace App\Rules;

use Closure;
use Illuminate\Contracts\Validation\ValidationRule;

class ForbiddenUsernames implements ValidationRule
{
    /**
     * Run the validation rule.
     *
     * @param  \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString  $fail
     */
    public function validate(string $attribute, mixed $value, Closure $fail): void
    {
        $forbidden = array_map('strtolower', config('auth.disabled_usernames'));

        if (in_array(strtolower($value), $forbidden)) {
            $fail('validation.custom.username')->translate();
        }
    }
}

Zerion Mini Shell 1.0