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

Name Parser Laravel Package

theiconic/name-parser

Language-independent PHP name parser that splits full names into parts like salutation, first/middle name, initials, nicknames, last name (incl. prefixes like von/de) and suffixes (Jr/III/PhD). Supports comma formats, multi-language rules, and customizable normalization/whitespace.

View on GitHub
Deep Wiki
Context7
v1.2.11
  • add support for combined initials - without separating space (e.g. in 'TJ Hooker' or 'T.J. Hooker') (This slightly changes the parsing behaviour as e.g. TJ Hooker would have previously ended up as Tj Hooker, with Tj being the first name. However, this was seen as a bug, so this change is not treated as a breaking change.)
v1.2.10
  • add support for multi-part salutations (e.g. 'Her Honour') (#29, thanks @rvanlaak)
  • fix parsing of combined lastnames with prefix (e.g. 'Heijdanus-De Boer') (#31, thanks @rvanlaak)
v1.2.9
  • support for 'Prof.' salutation (#24, thanks @baletskyi)
  • enable re-printing of given name (first name, middle names, initials) in given order (#21, thanks @jpmschuler)
  • enable re-printing of full name (given name plus last names) in given order
  • add test for custom language support (#23, thanks @ryancwalsh)
v1.2.8
  • add test cases for parsing and normalisation of vietnamese names (#17, thanks @yellow1912)
v1.2.7
  • enable parsing suffixes in patterns of the form lastname, firstname suffix where they were previously parsed as middle names (#18, thanks for reporting @adrienne)
  • add tests for lastname, firstname, suffix and lastname, firstname initial, suffix patterns
v1.2.6
  • limit salutation to the first half of the parts and allow overriding via setMaxSalutationIndex()
  • remap special values like suffix, nickname and salutation from the end of the string as lastnames if otherwise no lastname can be found (#11, thanks again @VinceG)
v1.2.5
  • support parsing of strings that have the salutation at the end without comma-separation (#11, thanks @VinceG)
  • add section about special part retrieval features in README
v1.2.4
  • enable separate retrieval of last name prefixes via getLastnamePrefix() and pure last names (without prefixes) via getLastname(true) (#10, thanks @divinenanny)
v1.2.3
  • correctly parse nickname-type segments even if they are in last position, e.g. Charles Dickens (20th century) (#8, thanks @divinenanny)
v1.2.2
  • fix for parsing of middle names in <lastname>, <firstname> <middlename> scenarios (thanks @francislavoie )
v1.2.1
  • normalisation now honors unicode characters if mbstring extension is enabled (#5, thanks @CodeDuck42)
  • dev-dependencies updated
v1.2.0
  • multi-language support for salutations, suffixes, lastname prefixes (introduces English and German language classes)
  • customisable salutations, suffixes, lastname prefixes and their normalisations
  • configurable nickname delimiters
  • replaced mapper option arrays with explicit constructor parameters
v1.1.0
  • support for ... , ... , ... name patterns
  • support for string-casting Name objects to the full name
  • improved salutation support
    • added Sir and Madam
    • added Mx. (non-binary) salutation
    • fixed normalisation of Miss to Miss, not to be confused with Ms.
  • more tests
  • added type-hinting
v1.0.3
  • update phpunit to 7.x
  • update php-coveralls to 2.x
  • report coverage to codeclimate
v1.0.2

Prevent the Initial mapper from taking over the last part of a name if it's a single letter - unless it's explicitly allowed to do so via an option. This allows mapping of 'B' in 'James B' as last name.

v1.0.1

Fix problem of flagging prefixes of a surname when there is not surname behind them(E.g: John Van)

v1.0.0
0.1.1
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.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
adachsoft/php-code-style