druc/person-name 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

druc/person-name

Composer 安装命令:

composer require druc/person-name

包简介

Presents one's name in various formats

README 文档

README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

PHP package to present one's name in various formats (doesn't include titulations).

Install

Via Composer

$ composer require druc/person-name

Usage

<?php
// Create instance
$name = PersonName::make('Constantin Druc');

// Get full name
$name->full; // Constantin Druc

// Get first name
$name->first; // Constantin

// Get last name
$name->last; // Druc

// Get name initials
$name->initials; // CD

// Get familiar name
$name->familiar; // Constantin D.

// Get abbreviated name
$name->abbreviated; // C. Druc

// Get sorted name
$name->sorted; // Druc, Constantin

// Get mentionable name
$name->mentionable; // constantind

// Get possessive name
$name->possessive; // Constantin Druc's

Laravel usage

Initially I wanted to build a Laravel-only package but thinking about it, you can always use an accessor like this:

<?php
// in App/User.php

public function getNameAttribute() 
{
    return PersonName::make($this->attributes['name']);
}

// Somewhere in your app
$user->name->familiar;

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email druc@pinsmile.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 55
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固