Package Data | |
---|---|
Maintainer Username: | eblount |
Maintainer Contact: | eric@ericmakesstuff.com (Eric Blount) |
Package Create Date: | 2015-05-17 |
Package Last Update: | 2015-05-18 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-19 03:21:30 |
Package Statistics | |
---|---|
Total Downloads: | 646 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
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.
Via Composer
$ composer require ericmakesstuff/display-name
$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
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
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email eric at ericmakesstuff dot com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.