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

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

ericmakesstuff/display-name
===========================

A simple package to show user's real names in a variety of Web-safe ways, i.e. Eric B. or E B. Also includes a Laravel Facade.

1.0.1(11y ago)4677MITPHPPHP &gt;=5.3.0

Since May 17Pushed 11y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

DisplayName
===========

[](#displayname)

[![Latest Version](https://camo.githubusercontent.com/6b9cae59b0c02d192bdaf76d7442e77f2fb01b5a870f528a89014d8de55e2eff/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f657269636d616b657373747566662f646973706c61792d6e616d652e7376673f7374796c653d666c61742d737175617265)](https://github.com/ericmakesstuff/display-name/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/4a819752704da3b33184430f0b9b304843fda3100b5611d904779e947e5e6a06/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f657269636d616b657373747566662f646973706c61792d6e616d652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/ericmakesstuff/display-name)[![Coverage Status](https://camo.githubusercontent.com/d8958396a77763cf51cd3bdf8007087e44c8fc51d525a4b88d2c04578e119741/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f657269636d616b657373747566662f646973706c61792d6e616d652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ericmakesstuff/display-name/code-structure)[![Quality Score](https://camo.githubusercontent.com/971b27e22bd3ec6885e27a56c5767d73727342eda0497a5865672c945bcb5dde/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f657269636d616b657373747566662f646973706c61792d6e616d652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ericmakesstuff/display-name)[![Total Downloads](https://camo.githubusercontent.com/296a9eda346993b3a8cc54881707bfacd9e79a56223082b5372ecc3806d82763/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f657269636d616b657373747566662f646973706c61792d6e616d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ericmakesstuff/display-name)

A simple package to show user's real names in a variety of Web-safe ways, i.e. Eric B. or E B. Also includes a Laravel Facade.

Install
-------

[](#install)

Via Composer

```
$ composer require ericmakesstuff/display-name
```

Usage
-----

[](#usage)

```
$displayName = new EricMakesStuff\DisplayName\DisplayName();
echo $displayName->fullName('John Smith'); // John Smith
echo $displayName->firstName('John Smith'); // John
echo $displayName->firstNameLastInitial('John Smith'); // John S
echo $displayName->firstNameLastInitialWithPeriod('John Smith'); // John S.
echo $displayName->initials('John Smith'); // JS
echo $displayName->initialsWithPeriods('John Smith'); // J.S.
echo $displayName->initialsWithSpaces('John Smith'); // J S
echo $displayName->format('John Smith', 'initials'); // JS
```

Laravel Facade
--------------

[](#laravel-facade)

Include the Service Provider in config/app.php

```
'EricMakesStuff\DisplayName\DisplayNameServiceProvider',
```

Include the Facade in config/app.php

```
'DisplayName' => 'EricMakesStuff\DisplayName\Facades\DisplayName',
```

Use the facade

```
DisplayName::firstName('John Smith') // John
DisplayName::format('John Smith', 'initials') // JS
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email eric at ericmakesstuff dot com instead of using the issue tracker.

Credits
-------

[](#credits)

- [Eric Blount](https://github.com/eblount)

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Every ~0 days

Total

2

Last Release

4019d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/34b37c820dfa62fdb44575c0056b47f97cdb77364cf7687eb3ab1a81bbd12a24?d=identicon)[eblount](/maintainers/eblount)

---

Top Contributors

[![eblount](https://avatars.githubusercontent.com/u/1424719?v=4)](https://github.com/eblount "eblount (15 commits)")

---

Tags

InitialsEricMakesStuffDisplayName

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ericmakesstuff-display-name/health.svg)

```
[![Health](https://phpackages.com/badges/ericmakesstuff-display-name/health.svg)](https://phpackages.com/packages/ericmakesstuff-display-name)
```

###  Alternatives

[lasserafn/php-initials

A package to generate initials in PHP

414.7M3](/packages/lasserafn-php-initials)[rackbeat/laravel-ui-avatars

Official Laravel wrapper around ui-avatars.com and LasseRafn/php-initial-avatar-generator

43144.3k](/packages/rackbeat-laravel-ui-avatars)

PHPackages © 2026

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