PHPackages                             permafrost-dev/laravel-str-extras - 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. permafrost-dev/laravel-str-extras

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

permafrost-dev/laravel-str-extras
=================================

Extra helper methods for the Laravel Str helper class.

1.0.1(3y ago)103[2 PRs](https://github.com/permafrost-dev/laravel-str-extras/pulls)MITPHPPHP ^8.1

Since May 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/permafrost-dev/laravel-str-extras)[ Packagist](https://packagist.org/packages/permafrost-dev/laravel-str-extras)[ Docs](https://github.com/permafrost-dev/laravel-str-extras)[ GitHub Sponsors](https://github.com/permafrost-dev)[ RSS](/packages/permafrost-dev-laravel-str-extras/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (5)Used By (0)

Extra methods for the Laravel Str suport class.
===============================================

[](#extra-methods-for-the-laravel-str-suport-class)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ee5bb1685afcd8c2a313f40f2ca37fec25e78f0adfebf22c63e79512f24c1193/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7065726d6166726f73742d6465762f6c61726176656c2d7374722d6578747261732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/permafrost-dev/laravel-str-extras)[![GitHub Tests Action Status](https://camo.githubusercontent.com/e4d7bc53328fd452575d7119fa119feb75a158c4d6a79d430353be7b91badad4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7065726d6166726f73742d6465762f6c61726176656c2d7374722d6578747261732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/permafrost-dev/laravel-str-extras/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/b35774ae93fd2c826f94afaa2dcf87d9e52acec2e343d567bf3ee6da5546ca5e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7065726d6166726f73742d6465762f6c61726176656c2d7374722d6578747261732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/permafrost-dev/laravel-str-extras/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/84c49540130a0584bf41f165bc9b8c09bc2ff08f58b053a62943d7a9e4678d3f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7065726d6166726f73742d6465762f6c61726176656c2d7374722d6578747261732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/permafrost-dev/laravel-str-extras)

Extra helper methods for the Laravel Str helper class.

### Additional Methods

[](#additional-methods)

- `insert()` - inserts a string at the specified position in the given string.
- `insertAfterMatch()` - inserts a string after the specified pattern match.
- `insertAfter()` - inserts a string after the specified substring.

### Examples

[](#examples)

```
$new = Str::insert('HelloWorld', '--', 5); //returns 'Hello--World'
$new = Str::insertAfterMatch('HelloWorld', '/(Hello)/', ' '); // returns 'Hello World'
$new = Str::insertAfter('HelloWorld', 'H', '_'); // returns 'H_elloWorld'
```

As far as making building web applications easier - consider the following use case:

```
// the identifier in the database is UA-1001, but we want to
// allow the user to provide the identifier without a dash for ease of entry:

$providedIdentifier = 'UA1001';
$actualIdentifier = Str::insertAfter($providedIdentifier, 'UA', '-');
$userExists = User::where('identifier', $actualIdentifier)->exists();
```

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

[](#installation)

You can install the package via composer:

```
composer require permafrost-dev/laravel-str-extras
```

Usage
-----

[](#usage)

```
$new = Str::insert('HelloWorld', '--', 5); //returns 'Hello--World'
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

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

[](#security-vulnerabilities)

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

Credits
-------

[](#credits)

- [Patrick Organ](https://github.com/patinthehat)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.9% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1098d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/de8dcb8e8a47ddc1076a26721d1ce7b17e3066b53c4a5c5e9aa31367c1955a20?d=identicon)[permafrost-dev](/maintainers/permafrost-dev)

---

Top Contributors

[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (11 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")

---

Tags

laravelstringshelper-functionspermafrost-devlaravel-str-extras

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/permafrost-dev-laravel-str-extras/health.svg)

```
[![Health](https://phpackages.com/badges/permafrost-dev-laravel-str-extras/health.svg)](https://phpackages.com/packages/permafrost-dev-laravel-str-extras)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

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