PHPackages                             watson/nameable - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. watson/nameable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

watson/nameable
===============

Format names of users into full, familiar and abbreviated forms

4.1.0(3mo ago)2912.2k—5.4%5MITPHPPHP ^8.2CI failing

Since Apr 22Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/dwightwatson/nameable)[ Packagist](https://packagist.org/packages/watson/nameable)[ Docs](https://github.com/dwightwatson/nameable)[ RSS](/packages/watson-nameable/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (8)Versions (12)Used By (0)

nameable
========

[](#nameable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5eab151ce7e521f09e6ef82496aef882222e787b869fee4328964b9f21f6afb2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776174736f6e2f6e616d6561626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/watson/nameable)[![Build Status](https://camo.githubusercontent.com/44c70e444ac0ec658bb550fb775bd74229a8c76f652ef8e6cb37522d98a95469/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f647769676874776174736f6e2f6e616d6561626c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/dwightwatson/nameable)[![Total Downloads](https://camo.githubusercontent.com/ecd4478687244f216b6ee38bc20b563acaea06b190e3bd3be3e2dee45d5f6cdc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f776174736f6e2f6e616d6561626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/watson/nameable)

This package provides a caster and a formatter class for presenting your user's names. It can get a user's first, last or full name, their initials, and common abbreviations. Instead of separating the fields over a few database columns you can store a user's name in a single column and fetch what you need.

This package is based upon Basecamp's [`name_of_person`](https://github.com/basecamp/name_of_person) package for Ruby/Rails.

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

[](#installation)

You can install the package via Composer:

```
composer require watson/nameable
```

Then use the `Nameable` cast for any Eloquent models you want to use as a name.

```
use Watson\Nameable\Nameable;

class User extends Model
{
    protected $casts = [
        'name' => Nameable::class,
    ];
}
```

Alternatively, you can interact with the `Name` class directly.

```
use Watson\Nameable\Name;

$name = new Name('Dwight', 'Conrad Watson');

$name = Name::from('Dwight Conrad Watson');
```

Usage
-----

[](#usage)

```
$user = new User(['name' => 'Dwight Watson']);

$user->name->full        // Dwight Watson
$user->name->first       // Dwight
$user->name->last        // Watson
$user->name->familiar    // Dwight W.
$user->name->abbreviated // D. Watson
$user->name->sorted      // Watson, Dwight
$user->name->initials    // DW
```

In addition there are possessive variants you can use which will work correctly with names that end in `s`.

```
$user = new User(['name' => 'Dwight Watson']);

$user->name->full_possessive        // Dwight Watson's
$user->name->first_possessive       // Dwight's
$user->name->last_possessive        // Watson's
$user->name->abbreviated_possessive // D. Watson's
$user->name->sorted_possessive      // Watson, Dwight's
$user->name->initials_possessive    // DW's

$user = new User(['name' => 'Angus Young']);
$user->name->full_possessive        // Angus Young's
$user->name->first_possessive       // Angus'
```

If a user doesn't provide a full name (for example, just a first name) the attributes will just omit the last name.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance81

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 76.2% 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

Every ~216 days

Recently: every ~278 days

Total

11

Last Release

101d ago

Major Versions

1.0.1 → 2.0.02020-09-09

2.4.0 → 3.0.02024-08-21

3.0.0 → 4.0.02025-09-18

PHP version history (6 changes)1.0.0PHP ^7.2.5

2.0.0PHP ^7.3

2.0.1PHP ^7.3|^8.0

2.1.0PHP ^8.0

3.0.0PHP ^8.1

4.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1100408?v=4)[Dwight Watson](/maintainers/dwightwatson)[@dwightwatson](https://github.com/dwightwatson)

---

Top Contributors

[![dwightwatson](https://avatars.githubusercontent.com/u/1100408?v=4)](https://github.com/dwightwatson "dwightwatson (32 commits)")[![bensondevs](https://avatars.githubusercontent.com/u/76855099?v=4)](https://github.com/bensondevs "bensondevs (3 commits)")[![mischasigtermans](https://avatars.githubusercontent.com/u/22501510?v=4)](https://github.com/mischasigtermans "mischasigtermans (2 commits)")[![vanthao03596](https://avatars.githubusercontent.com/u/34786441?v=4)](https://github.com/vanthao03596 "vanthao03596 (2 commits)")[![johnbacon](https://avatars.githubusercontent.com/u/308588?v=4)](https://github.com/johnbacon "johnbacon (1 commits)")[![danharrin](https://avatars.githubusercontent.com/u/41773797?v=4)](https://github.com/danharrin "danharrin (1 commits)")[![ralphjsmit](https://avatars.githubusercontent.com/u/59207045?v=4)](https://github.com/ralphjsmit "ralphjsmit (1 commits)")

---

Tags

laravellaravelnamescaster

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/watson-nameable/health.svg)

```
[![Health](https://phpackages.com/badges/watson-nameable/health.svg)](https://phpackages.com/packages/watson-nameable)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M281](/packages/illuminate-pipeline)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)

PHPackages © 2026

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