定制 robbielove/laravel-lobster-name 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

robbielove/laravel-lobster-name

Composer 安装命令:

composer require robbielove/laravel-lobster-name

包简介

Give your Eloquent models ridiculously fun alter-ego names. Lobster names, pirate names, wizard names, rapper names, and 25+ more.

README 文档

README

Software License Latest Version

Give your Eloquent models ridiculously fun alter-ego names. 36 name types from lobster to pirate to robot.

$ php artisan lobster:name "Robbie" --all

  Lobster ……………… Robbie Robster
  Dog …………………………… Rob Dog
  Doctor …………………… Dr. Robbie
  Judge ………………………… The Honourable Judge Robbie
  King ……………………………… Your Highness, Robbie
  Queen ………………………… Your Majesty, Robbie
  Initial …………………… R
  Backwards ………… eibboR
  Pirate …………………… Captain Robbie Stormborn
  Ninja ………………………… Whisper Robbie
  Wizard …………………… Robbie the Unbroken
  Rapper …………………… DJ Robbie
  Spy ……………………………… Agent R
  Chef ……………………………… Chef Robbie
  Wrestler ………… The Robster
  Viking …………………… Robbie the Ruthless
  Superhero ………… The Spectacular Robbie
  Villain ……………… Robbie the Merciless
  Cowboy …………………… Robbie "Lone Star" McCoy
  Rockstar ………… Robbie Havoc
  Mafia ………………………… Robbie "The Bull"
  Detective ………… Detective Robbie
  Professor ………… Professor Robbie
  President ………… President Robbie
  Robot ………………………… R-8279-E
  Medieval ………… Sir Robbie of Thornwall
  Alien ………………………… Nyx-Robbie of the Outer Rim
  Elf ……………………………… Robbieiel Nightbloom
  Dwarf ………………………… Robbiin Deepdelve
  Cat ……………………………… Robbie Pawsworth
  Formal …………………… The Right Honourable Robbie
  Stage ………………………… R.Nova
  Baby ……………………………… Widdle Wobbie
  Shouting ………… ROBBIE!!!
  Whisper ……………… ...robbie...
  Acronym ……………… R.O.B.B.I.E.

Install

composer require robbielove/laravel-lobster-name

Supports Laravel 9, 10, 11, and 12. Requires PHP 8.0+.

Usage

On Eloquent models

Add the trait to any model with a name attribute:

use Robbielove\LobsterName\Traits\HasLobsterName;

class User extends Model
{
    use HasLobsterName;
}

$user = User::find(1); // name = "Robbie"

$user->lobster_name;    // "Robbie Robster"
$user->pirate_name;     // "Captain Robbie Stormborn"
$user->ninja_name;      // "Whisper Robbie"
$user->wizard_name;     // "Robbie the Unbroken"
$user->rapper_name;     // "DJ Robbie"
$user->spy_name;        // "Agent R"
$user->robot_name;      // "R-8279-E"
$user->baby_name;       // "Widdle Wobbie"
$user->random_name;     // (surprise!)
$user->all_names;       // [...all 36 names as an array]
$user->name_card;       // formatted string of all names

Custom name column

If your model uses something other than name:

class Customer extends Model
{
    use HasLobsterName;

    protected string $lobsterNameColumn = 'first_name';
}

Standalone (no model needed)

use Robbielove\LobsterName\LobsterName;

$lobster = new LobsterName('Sammy');
$lobster->lobster_name;  // "Sammy Sobster"
$lobster->pirate_name;   // "Captain Sammy Redbeard"

// Static factory
LobsterName::for('Alice')->wizard_name;  // "Alice the Eternal"

// Dump all names
echo LobsterName::for('Robbie');  // prints the full name card

Artisan command

# Show curated highlights
php artisan lobster:name "Robbie"

# Show all 36 name types
php artisan lobster:name "Robbie" --all

# Get a specific type
php artisan lobster:name "Robbie" --type=pirate

All Name Types

Accessor Example (for "Robbie")
lobster_name Robbie Robster
dog_name Rob Dog
doctor_name Dr. Robbie
judge_name The Honourable Judge Robbie
king_name Your Highness, Robbie
queen_name Your Majesty, Robbie
initial_name R
backwards_name eibboR
pirate_name Captain Robbie Stormborn
ninja_name Whisper Robbie
wizard_name Robbie the Unbroken
rapper_name DJ Robbie
spy_name Agent R
chef_name Chef Robbie
wrestler_name The Robster
viking_name Robbie the Ruthless
superhero_name The Spectacular Robbie
villain_name Robbie the Merciless
cowboy_name Robbie "Lone Star" McCoy
rockstar_name Robbie Havoc
mafia_name Robbie "The Bull"
detective_name Detective Robbie
professor_name Professor Robbie
president_name President Robbie
robot_name R-8279-E
medieval_name Sir Robbie of Thornwall
alien_name Nyx-Robbie of the Outer Rim
elf_name Robbieiel Nightbloom
dwarf_name Robbiin Deepdelve
cat_name Robbie Pawsworth
formal_name The Right Honourable Robbie
stage_name R.Nova
baby_name Widdle Wobbie
shouting_name ROBBIE!!!
whisper_name ...robbie...
acronym_name R.O.B.B.I.E.

Names with variable suffixes (pirate, ninja, wizard, etc.) are deterministic — the same input name always produces the same output. No database, no randomness, just vibes.

Testing

composer test

35 tests, 60 assertions.

Contributing

See CONTRIBUTING for details.

Credits

License

MIT. See LICENSE.

robbielove/laravel-lobster-name 适用场景与选型建议

robbielove/laravel-lobster-name 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 02 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「generator」 「trait」 「laravel」 「eloquent」 「fun」 「names」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 robbielove/laravel-lobster-name 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 robbielove/laravel-lobster-name 我们能提供哪些服务?
定制开发 / 二次开发

基于 robbielove/laravel-lobster-name 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-19