PHPackages                             boomdraw/laravel-str - 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. boomdraw/laravel-str

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

boomdraw/laravel-str
====================

Extends \\Illuminate\\Support\\Str with additional string helpers

v1.1.1(6y ago)01.9kMITPHPPHP ^7.2

Since Aug 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/boomdraw/laravel-str)[ Packagist](https://packagist.org/packages/boomdraw/laravel-str)[ RSS](/packages/boomdraw-laravel-str/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Laravel Str Helper
==================

[](#laravel-str-helper)

A package that extends `\Illuminate\Support\Str` with additional string helpers

[![Build Status](https://camo.githubusercontent.com/c39c8dd32d536b082eacac6188875bbbb0b833e533aada85d88ec56bc4610678/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f626f6f6d647261772f6c61726176656c2d7374722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/boomdraw/laravel-str)[![StyleCI](https://camo.githubusercontent.com/a1cf6cd2213911cea828b33111090ae58578748ba56089de39fd9b388d164d96/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3230303335333036382f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/200353068)[![Code Coverage](https://camo.githubusercontent.com/4731c2f860f1489d907830c16c61f3b9ca0523f1d52abf71d20506b6c1d9ed81/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f626f6f6d647261772f6c61726176656c2d7374722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/boomdraw/laravel-str)[![Quality Score](https://camo.githubusercontent.com/2ff3627001e286cae3a9112a69ba8fd511dbc5fdedd50f974a1092dbfb21869b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f626f6f6d647261772f6c61726176656c2d7374722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/boomdraw/laravel-str)[![Latest Version on Packagist](https://camo.githubusercontent.com/4a52f6f044dec31f01944b33b27f51817e9e83011b3f6d54a7938c3c4b4eb6db/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626f6f6d647261772f6c61726176656c2d7374723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/boomdraw/laravel-str)[![Total Downloads](https://camo.githubusercontent.com/f0e96443459e818dad44b07b8580edc74721215dd46c0c54743bb796a83af1f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626f6f6d647261772f6c61726176656c2d7374722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/boomdraw/laravel-str)[![PHP Version](https://camo.githubusercontent.com/56508cce091e174ab1a746b94917ff7770d516943e580765dd0e9682825c5f99/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f626f6f6d647261772f6c61726176656c2d7374723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/boomdraw/laravel-str)[![License](https://camo.githubusercontent.com/7dd2415c8735e39bf07a61c1695b0f9f712282cbae3a77d798c5c5569683c6a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f626f6f6d647261772f6c61726176656c2d7374723f7374796c653d666c61742d7371756172653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/boomdraw/laravel-str)

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

[](#installation)

Via Composer

```
composer require boomdraw/laravel-str
```

### Laravel

[](#laravel)

The package will automatically register itself.

### Lumen

[](#lumen)

Register `StrServiceProvider`

```
// bootstrap/app.php:
$app->register(Boomdraw\Str\StrServiceProvider::class);
```

Usage and methods
-----------------

[](#usage-and-methods)

```
use Illuminate\Support\Str;
```

### between

[](#between)

The function returns the portion of the string specified by the start and end parameters.

```
Str::between(string $string, string $start, string $end, bool $strict = true);
```

The function returns string between `$start` and `$end`.

```
Str::between('foo bar baz', 'foo ', ' baz') === 'bar';
```

The function returns `false` if `$strict = true` and `$start` or `$end` is missing in the `$string`.

```
Str::between('foo bar baz', 'test ', ' test') === false;
```

```
Str::between('foo bar baz', 'foo ', ' test') === false;
```

```
Str::between('foo bar baz', 'test ', ' baz') === false;
```

For the disabled strict mode result will be:

- source `$string` if `$start` and `$end` are missing in the `$string`.

```
Str::between('foo bar baz', 'test ', ' test', false) === 'foo bar baz';
```

- source `$string` before `$end` if `$start` is missing in the `$string`.

```
Str::between('foo bar baz', 'test ', ' baz', false) === 'foo bar';
```

- source `$string` after `$start` if `$end` is missing in the `$string`.

```
Str::between('foo bar baz', 'foo ', ' test', false) === 'bar baz';
```

### wbetween

[](#wbetween)

The function returns the portion of the string specified by the start and end parameters wrapped with those parameters.

```
Str::wbetween(string $string, string $start, string $end, bool $strict = true);
```

The function returns string between `$start` and `$end` wrapped with `$start` and `$end`.

```
Str::wbetween('goo foo bar baz haz', 'foo ', ' baz') === 'foo bar baz';
```

The function returns `false` if `$strict = true` and `$start` or `$end` is missing in the `$string`.

```
Str::wbetween('goo foo bar baz haz', 'test ', ' test') === false;
```

```
Str::wbetween('goo foo bar baz haz', 'foo ', ' test') === false;
```

```
Str::wbetween('goo foo bar baz haz', 'test ', ' baz') === false;
```

For the disabled strict mode result will be:

- source `$string` if `$start` and `$end` are missing in the `$string`.

```
Str::wbetween('goo foo bar baz haz', 'test ', ' test', false) === 'goo foo bar baz haz';
```

- source `$string` without substring after `$end` if `$start` is missing in the `$string`.

```
Str::wbetween('goo foo bar baz haz', 'test ', ' baz', false) === 'goo foo bar baz';
```

- source `$string` without substring before `$start` if `$end` is missing in the `$string`.

```
Str::wbetween('goo foo bar baz haz', 'foo ', ' test', false) === 'foo bar baz haz';
```

### utrim

[](#utrim)

The function calls `trim()` function with slash (`/`) and backslash (`\`) added to charlist.

```
Str::utrim(string $string): string;
```

```
Str::utrim("\hello world \n") === 'hello world';
```

Testing
-------

[](#testing)

You can run the tests with:

```
composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details and a todo list.

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

[MIT](http://opensource.org/licenses/MIT)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~43 days

Total

4

Last Release

2393d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12460074?v=4)[boomdraw](/maintainers/boomdraw)[@boomdraw](https://github.com/boomdraw)

---

Top Contributors

[![boomdraw](https://avatars.githubusercontent.com/u/12460074?v=4)](https://github.com/boomdraw "boomdraw (4 commits)")[![JShantal](https://avatars.githubusercontent.com/u/9612943?v=4)](https://github.com/JShantal "JShantal (2 commits)")

---

Tags

laravelstringhelpers

### Embed Badge

![Health badge](/badges/boomdraw-laravel-str/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[pishran/laravel-persian-string

Convert Arabic/English/etc numbers and characters to Persian numbers and characters in Laravel models.

206.8k](/packages/pishran-laravel-persian-string)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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