PHPackages                             shawnveltman/texthelpers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. shawnveltman/texthelpers

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shawnveltman/texthelpers
========================

A short collection of text helpers that dont yet exist in the Laravel string helpers

01.2k[2 PRs](https://github.com/shawnveltman/texthelpers/pulls)PHPCI passing

Since Mar 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/shawnveltman/texthelpers)[ Packagist](https://packagist.org/packages/shawnveltman/texthelpers)[ RSS](/packages/shawnveltman-texthelpers/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

This is my package texthelpers
==============================

[](#this-is-my-package-texthelpers)

[![Latest Version on Packagist](https://camo.githubusercontent.com/39d14c80bc99e4e9f050287cac63920be341a514a03f879c0ef53e8e98f9f351/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736861776e76656c746d616e2f7465787468656c706572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/shawnveltman/texthelpers)[![GitHub Tests Action Status](https://camo.githubusercontent.com/4775a2dab47cf770cb311ade6cf77adf79f2668665243004a92d27e2c51e0f41/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f736861776e76656c746d616e2f7465787468656c706572732f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/shawnveltman/texthelpers/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4291ab0fd4c5145beaccf179bd2d737aefa9961e831e652c33015d372c84e8e4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f736861776e76656c746d616e2f7465787468656c706572732f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/shawnveltman/texthelpers/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/d3cf9a98094d3ab0dc9171de1103470710e3cd48ce3a1cb96eff8c30f35c4d58/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736861776e76656c746d616e2f7465787468656c706572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/shawnveltman/texthelpers)

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require shawnveltman/texthelpers
```

Usage
-----

[](#usage)

```
use \Shawnveltman\Texthelpers\TextTrait;
```

Methods
-------

[](#methods)

This package contains a trait with the following functions:

```
stripEverythingButNumbersAndPeriods

stripEverythingButNumbers

money_from_cents
Takes in a string or integer with no decimal point (12345), and returns it formatted as a dollar string ($123.45)

money_from_dollars
Takes in a string or integer with a decimal point (123.45), and returns it formatted as a dollar string ($123.45)

format_phone_number
Formats a 10 digit phone number as (xxx) xxx-xxxx (also strips leading 1s)

get_twilio_formatted_number
Adds a +1 to a 10 digit phone number (+1xxxxxxxxxx)

get_ten_digit_phone_number

format_postal_code
Splits a 6 digit string into 2 3 digit components (A1B 2C3)

```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Shawn Veltman](https://github.com/shawnveltman)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8326484?v=4)[Shawn Veltman](/maintainers/shawnveltman)[@shawnveltman](https://github.com/shawnveltman)

---

Top Contributors

[![shawnveltman](https://avatars.githubusercontent.com/u/8326484?v=4)](https://github.com/shawnveltman "shawnveltman (43 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (30 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (26 commits)")

### Embed Badge

![Health badge](/badges/shawnveltman-texthelpers/health.svg)

```
[![Health](https://phpackages.com/badges/shawnveltman-texthelpers/health.svg)](https://phpackages.com/packages/shawnveltman-texthelpers)
```

###  Alternatives

[sugarcrm/tidbit

Random data generator for Sugar

4525.0k](/packages/sugarcrm-tidbit)[mindtwo/native-enum

Package for using native php enums.

2630.2k1](/packages/mindtwo-native-enum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
