PHPackages                             webmintydotcom/laravel-person-name - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. webmintydotcom/laravel-person-name

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

webmintydotcom/laravel-person-name
==================================

A Laravel validation rule to validate a person's first and last name.

1.0.0(2mo ago)0101MITPHPPHP ^8.2

Since Apr 9Pushed 2mo agoCompare

[ Source](https://github.com/webmintydotcom/laravel-person-name)[ Packagist](https://packagist.org/packages/webmintydotcom/laravel-person-name)[ RSS](/packages/webmintydotcom-laravel-person-name/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Laravel Person Name
===================

[](#laravel-person-name)

A Laravel validation rule for validating a person's first and last name. Unicode-safe and supports names from any language or culture.

Installation
------------

[](#installation)

```
composer require webmintydotcom/laravel-person-name
```

The service provider is auto-discovered by Laravel.

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use Webminty\PersonName\Rules\ValidPersonName;

$request->validate([
    'first_name' => ['required', new ValidPersonName],
    'last_name' => ['required', new ValidPersonName],
]);
```

### Custom Minimum Length

[](#custom-minimum-length)

The default minimum length is 2 characters. You can change it:

```
$request->validate([
    'first_name' => ['required', new ValidPersonName(minLength: 1)],
    'last_name' => ['required', new ValidPersonName(minLength: 3)],
]);
```

### In a Form Request

[](#in-a-form-request)

```
use Webminty\PersonName\Rules\ValidPersonName;

class StoreUserRequest extends FormRequest
{
    public function rules(): array
    {
        return [
            'first_name' => ['required', new ValidPersonName],
            'last_name' => ['required', new ValidPersonName],
        ];
    }
}
```

What It Validates
-----------------

[](#what-it-validates)

The rule checks that a name:

- Is a string
- Meets the minimum length (default: 2)
- Starts and ends with a letter
- Only contains letters, spaces, hyphens, apostrophes, and periods

### Valid Names

[](#valid-names)

NameWhy`John`Simple name`Smith-Jones`Hyphenated`O'Brien`Apostrophe`De La Cruz`Spaces`St. John`Period`Jose`Accented characters`Munoz`Tilde`Dmitriy`Cyrillic`Muhammad`Arabic`Taro`CJK characters### Invalid Names

[](#invalid-names)

InputWhy`A`Too short (default min: 2)`John3`Contains numbers`John@Doe`Special characters`John-`Trailing hyphen`John'`Trailing apostrophe` `Only spacesError Messages
--------------

[](#error-messages)

The package includes English translations out of the box:

- `The :attribute must be a string.`
- `The :attribute must be at least :min characters.`
- `The :attribute may only contain letters, spaces, hyphens, apostrophes, and periods.`

### Customizing Messages

[](#customizing-messages)

Publish the translations to customize them:

```
php artisan vendor:publish --tag=person-name-translations
```

Or override them inline:

```
$request->validate(
    ['first_name' => ['required', new ValidPersonName]],
    ['first_name.Webminty\PersonName\Rules\ValidPersonName' => 'Please enter a valid first name.'],
);
```

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11, 12, or 13

License
-------

[](#license)

MIT

Thank you
---------

[](#thank-you)

[Webminty](https://webminty.com) team

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance88

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

61d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6df96861ef914619e7d981dda936319ef29c8fcdf2f47c4a5c2e8f6ec25e3ff0?d=identicon)[webmintydotcom](/maintainers/webmintydotcom)

---

Top Contributors

[![webmintydotcom](https://avatars.githubusercontent.com/u/176715447?v=4)](https://github.com/webmintydotcom "webmintydotcom (1 commits)")

---

Tags

laravelvalidationPersonnamefirst namelast name

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/webmintydotcom-laravel-person-name/health.svg)

```
[![Health](https://phpackages.com/badges/webmintydotcom-laravel-person-name/health.svg)](https://phpackages.com/packages/webmintydotcom-laravel-person-name)
```

###  Alternatives

[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k38.3M138](/packages/propaganistas-laravel-phone)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

762621.7k17](/packages/wendelladriel-laravel-validated-dto)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2462.3M6](/packages/laravel-validation-rules-credit-card)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M50](/packages/proengsoft-laravel-jsvalidation)[prettus/laravel-validation

Laravel Validation Service

42011.2M52](/packages/prettus-laravel-validation)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76318.2M110](/packages/laravel-mcp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
