shawnveltman / texthelpers
A short collection of text helpers that dont yet exist in the Laravel string helpers
Fund package maintenance!
shawnveltman
Requires
- php: ^8.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- infection/infection: ^0.25.5
- nunomaduro/collision: ^5.10
- nunomaduro/larastan: ^1.0
- orchestra/testbench: ^6.22
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- pestphp/pest-plugin-parallel: ^1.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-10-28 22:59:32 UTC
README
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
Installation
You can install the package via composer:
composer require shawnveltman/texthelpers
Usage
use \Shawnveltman\Texthelpers\TextTrait;
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
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.