Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Nameable Laravel Package

watson/nameable

A Laravel package for giving Eloquent models human-readable names through a polymorphic relationship. Add the trait to any model to store and retrieve names without repeating name columns across tables.

View on GitHub
Deep Wiki
Context7

Laravel Eloquent caster for convenient name formatting

Frequently asked questions about Nameable
What is watson/nameable used for in Laravel?
watson/nameable is a small Laravel utility for giving Eloquent models human-readable names. It provides a caster for convenient name formatting and a trait that stores names through a polymorphic relationship, so you do not repeat name columns across tables. It is best treated as a presentation or domain helper rather than an identity platform.
How do I install watson/nameable with Composer?
Install it with Composer using composer require watson/nameable. The package is a Laravel dependency, so confirm the version constraint matches your application's Laravel and PHP matrix before committing. After installation, add the package trait or caster to the model that needs name formatting.
Which Laravel and PHP versions does watson/nameable support?
The provided context does not list specific Laravel or PHP version constraints, so check the package's composer.json and README before installing. Pin the Composer version and add CI coverage for every Laravel and PHP version you support. Because the package has low adoption, validate compatibility in a non-production branch first.
How do I add name formatting to an Eloquent model with watson/nameable?
Add the package trait to an Eloquent model and use its formatter or caster to retrieve full, familiar, and abbreviated name forms. The trait supports storing and retrieving names through a polymorphic relationship, which avoids duplicating name columns. Keep direct package calls behind an internal adapter so you can replace the implementation later.
Does watson/nameable handle null, empty, or partial names?
The package formats name strings, so your application must define fallback behavior for null, empty, or partial names. The TPM assessment flags nullable names and mononyms as edge cases that need explicit tests. Wrap the package in an internal formatter that returns safe defaults for missing name parts.
Can watson/nameable format Unicode and non-Western names correctly?
The assessment calls out Unicode and non-Western naming patterns as risks that require validation with representative names. Do not assume the package handles every cultural naming convention correctly. Run a spike and tests with Unicode, mononyms, prefixes, suffixes, and locale-specific cases before user-facing rollout.
Is name formatting in watson/nameable configurable by locale or user preference?
The context does not confirm locale-aware or user-preference formatting, so treat configurability as something to verify in the README and source. If you need locale-specific output, implement it in your own NameFormatter adapter around the package. That keeps formatting rules and fallbacks under application control.
Can I use watson/nameable in production or is it too low maturity?
It can be used in production only with caution because the package has 30 stars, zero dependents, and a low maturity score. Treat it as a low-risk convenience library, isolate it behind an interface, and assign an internal owner. Pin versions, monitor upstream releases, and budget for a small fallback or fork if maintenance stalls.
How should I test name formatting with watson/nameable?
Write tests for nulls, single names, Unicode, initials, prefixes, suffixes, and locale cases using representative data. Test the adapter rather than the package directly so your suite protects application behavior. Include serialization tests if formatted names are exposed through APIs or exports.
What are alternatives to watson/nameable for Laravel name formatting?
Alternatives include a simple Laravel accessor, a custom cast, or an internal NameFormatter service that implements full, familiar, and abbreviated formats. Because the package is small, forking or reimplementing it is a realistic fallback. The key is to keep formatting behind an interface so replacing watson/nameable is cheap.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package