PHPackages                             humans/name-of-person - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. humans/name-of-person

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

humans/name-of-person
=====================

A wrappr for parsing people's names.

4.0.0(5y ago)922.2k↓18.8%[1 issues](https://github.com/humans/name-of-person/issues)MITPHPPHP &gt;=7.3.0CI failing

Since Oct 1Pushed 5y ago4 watchersCompare

[ Source](https://github.com/humans/name-of-person)[ Packagist](https://packagist.org/packages/humans/name-of-person)[ RSS](/packages/humans-name-of-person/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (14)Used By (0)

Name of Person
==============

[](#name-of-person)

A port of [Basecamp's name of person library](https://github.com/basecamp/name_of_person).

A library to make an much more expressive breakdown of a user's name.

This is a pretty simplified library without accounting for any of the edge cases of how names are handled, just something usable where everything *after* the first name is treated as the last name.

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

[](#installation)

```
composer require humans/name-of-person
```

Upgrade Notes
-------------

[](#upgrade-notes)

The API now returns an instance of the `PersonName` class instead of the string to allow for method chaining. This should not affect most of the use cases.

Usage
-----

[](#usage)

```
use Humans\NameOfPerson\PersonName;

$name = new PersonName('Terry Crews');

$name->full;              // => "Terry Crews"
$name->first;             // => "Terry"
$name->last;              // => "Crews"
$name->initials;          // => "TC"
$name->familiar;          // => "Terry C."
$name->abbreviated;       // => "T. Crews"
$name->sorted;            // => "Crews, Terry"
$name->mentionable;       // => "terryc"
$name->possessive;        // => "Terry Crews'"
$name->first->possessive  // => Terry's
$name->last->possessive   // => Crews'
```

The Laravel Trait has been removed!
-----------------------------------

[](#the-laravel-trait-has-been-removed)

I ended up not using the trait since there are projects that I wanted to use a different key for the name. Instead, if you want to use the library, I highly suggest using a different attribute to avoid conflicts when building JSON APIs.

```
use Humans\NameOfPerson\PersonName;

class User
{
    public function getNameAttribute()
    {
        return new PersonName($this->attributes['full_name']);
    }
}
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Every ~56 days

Recently: every ~30 days

Total

12

Last Release

2172d ago

Major Versions

1.0.2 → 2.0.02019-04-14

2.1.0 → 3.0.02020-02-09

3.2.0 → 4.0.02020-06-07

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21359371?v=4)[Humans](/maintainers/humans)[@humans](https://github.com/humans)

---

Tags

namephppresenter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/humans-name-of-person/health.svg)

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

###  Alternatives

[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)

PHPackages © 2026

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