claraleigh/naughty-username

Validate that a username is not a naughty one

Installs: 5 057

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

0.3.1 2024-06-07 02:00 UTC

This package is auto-updated.

Last update: 2024-11-07 02:54:55 UTC


README

Installation

composer require claraleigh/naughty-username

Usage

use Claraleigh\NaughtyUsername\NaughtyUsername;

// Test if a username is naughty
$request->validate([
    'username' => [
        'required',
        new NaughtyUsername(),
    ],
]);


// Use your own list of naughty usernames
$request->validate([
    'username' => [
        'required',
        new NaughtyUsername(
            ['path/to/blacklist.js'],
            ['path/to/whitelist.js']
        ),
    ],
]);