Sorry, no results were found for this search.

Username Rule

Validate a Typical Username

172k Downloads / Month

Open Source MIT License

Validate username formats in Laravel with Intervention Validation. Check username pattern and format.

public Intervention\Validation\Rules\Username::__construct()

The field under validation must be a valid username consisting of alphanumeric characters, underscores, and hyphens, starting with an alphabetic character. Multiple consecutive underscores and hyphens are not allowed. Underscores and hyphens are not allowed at the beginning or end.

Parameters

none

Example

use Illuminate\Support\Facades\Validator;
use Intervention\Validation\Rules\Username;

$validator = Validator::make($request->all(), [
    'attribute-key' => new Username(),
]);
Edit