PHPackages                             thestringler-laravel/manipulator - 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. thestringler-laravel/manipulator

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

thestringler-laravel/manipulator
================================

A Laravel package for The Stringler

v1.1.0(9y ago)315.1k8[1 issues](https://github.com/mattsparks/the-stringler-laravel/issues)MITPHP

Since Jul 15Pushed 8y ago2 watchersCompare

[ Source](https://github.com/mattsparks/the-stringler-laravel)[ Packagist](https://packagist.org/packages/thestringler-laravel/manipulator)[ RSS](/packages/thestringler-laravel-manipulator/feed)WikiDiscussions master Synced today

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

The Stringler Laravel Package
=============================

[](#the-stringler-laravel-package)

A Laravel package for [The Stringler](https://github.com/mattsparks/the-stringler), a string manipulation class.

Install
-------

[](#install)

Compsoser:

```
composer require thestringler-laravel/manipulator

```

After composer has done its thing, add the package service provider to the array in `/config/app.php`:

```
TheStringlerLaravel\Manipulator\ManipulatorServiceProvider::class
```

Then add the facade to the aliases array, also in `config/app.php`:

```
'Manipulator' => TheStringlerLaravel\Manipulator\ManipulatorFacade::class,
```

Helper function:

```
$string = manipulate('hello')->toUpper();
```

Methods
-------

[](#methods)

### append($string)

[](#appendstring)

```
manipulate('Freak')->append(' Out!');
// Freak Out!
```

### camelToSnake

[](#cameltosnake)

```
manipulate('camelCase')->camelToSnake();
// camel_case
```

### camelToClass

[](#cameltoclass)

```
manipulate('className')->camelToClass();
// ClassName
```

### capitalize

[](#capitalize)

```
manipulate('hello')->capitalize();
// Hello
```

### capitalizeEach

[](#capitalizeeach)

```
manipulate('i like toast!')->capitalizeEach();
// I Like Toast!
```

### eachCharacter($closure)

[](#eachcharacterclosure)

```
manipulate('hello')->eachCharacter(function($char) {
    return strtoupper($char);
});
// HELLO
```

### eachWord($closure, $preserveSpaces = false)

[](#eachwordclosure-preservespaces--false)

```
manipulate('hello moto')->eachWord(function($word) {
    return strrev($word);
});
// ollehotom

manipulate('hello moto')->eachWord(function($word) {
    return strrev($word);
}, true);
// olleh otom
```

### getPossessive

[](#getpossessive)

```
manipulate('Bob')->getPossessive();
// Bob's
manipulate('Silas')->getPossessive();
// Silas'
```

### htmlEntities($flags = ENT\_HTML5, $encoding = 'UTF-8', $doubleEncode = true)

[](#htmlentitiesflags--ent_html5-encoding--utf-8-doubleencode--true)

```
manipulate('&')->htmlEntities();
// &amp;
```

### htmlEntitiesDecode($flags = ENT\_HTML5, $encoding = 'UTF-8')

[](#htmlentitiesdecodeflags--ent_html5-encoding--utf-8)

```
manipulate('&amp;')->htmlEntitiesDecode();
// &
```

### htmlSpecialCharacters($flags = ENT\_HTML5, $encoding = 'UTF-8', $doubleEncode = true)

[](#htmlspecialcharactersflags--ent_html5-encoding--utf-8-doubleencode--true)

```
manipulate('&')->htmlSpecialCharacters();
// &amp;&lt;&gt;
```

### lowercaseFirst

[](#lowercasefirst)

```
manipulate('HELLO')->lowercaseFirst();
// hELLO
```

### pad($length, $string, $type = null)

[](#padlength-string-type--null)

```
manipulate('Hello')->pad(2, '!!', STR_PAD_RIGHT);
// Hello!!
```

### prepend($string)

[](#prependstring)

```
manipulate('is the one.')->prepend('Neo ');
// Neo is the one.
```

### pluralize($items = null)

[](#pluralizeitems--null)

```
manipulate('Potato')->pluralize();
// Potatoes
```

You can optionally pass an array or numeric value to `pluaralize` to determine if the given string should be pluaralized.

```
$dogs = ['Zoe', 'Spot', 'Pickles'];
manipulate('Dog')->pluralize($dogs);
// Dogs

$cats = ['Whiskers'];
manipulate('Cat')->pluralize($cats);
// Cat
```

### nthCharacter($nth, $closure)

[](#nthcharacternth-closure)

```
manipulate('Wordpress')->nthCharacter(5, function($character) {
    return mb_strtoupper($character);
});
// WordPress
```

### nthWord($nth, $closure, $preserveSpaces = true)

[](#nthwordnth-closure-preservespaces--true)

```
manipulate('Oh hello there!')->nthWord(2, function($word) {
    return mb_strtoupper($word);
});
// Oh HELLO there!
```

### remove($string, $caseSensitive = true)

[](#removestring-casesensitive--true)

```
manipulate('Dog Gone')->remove('Gone');
// Dog
```

### removeSpecialCharacters($exceptions = \[\])

[](#removespecialcharactersexceptions--)

```
manipulate('Hello!!')->removeSpecialCharacters();
// Hello
manipulate('Hello!!')->removeSpecialCharacters(['!']);
// Hello!!
```

### repeat($multiplier = 1)

[](#repeatmultiplier--1)

```
manipulate('la')->repeat(3);
// lalala
```

### replace($find, $replace = '', $caseSensitive = true)

[](#replacefind-replace---casesensitive--true)

```
manipulate('Pickles are good.')->replace('good', 'terrible');
// Pickles are terrible.
```

### reverse

[](#reverse)

```
manipulate('Whoa!')->reverse();
// !aohW
```

### snakeToCamel

[](#snaketocamel)

```
manipulate('snake_case')->snakeToCamel();
// snakeCase
```

### snakeToClass

[](#snaketoclass)

```
manipulate('class_name')->snakeToClass();
// ClassName
```

### stripTags($allowed = '')

[](#striptagsallowed--)

```
manipulate('Hello')->stripTags();
// Hello
```

### toCamelCase

[](#tocamelcase)

```
manipulate('camel case')->toCamelCase();
// camelCase
```

### toL33t

[](#tol33t)

```
manipulate('Hack The Planet!')->toL33t();
// (-)@{|< +/-/€ |O7@|\|€][!
```

### toLower

[](#tolower)

```
manipulate('LOWER')->toLower();
// lower
```

### toSlug

[](#toslug)

```
manipulate('This is a slug!')->toSlug();
// this-is-a-slug
```

### toSnakeCase

[](#tosnakecase)

```
manipulate('snake case')->toSnakeCase();
// snake_case
```

### toString

[](#tostring)

This method just returns the string.

### toUpper

[](#toupper)

```
manipulate('upper')->toUpper();
// UPPER
```

### trim

[](#trim)

```
manipulate('  trimmed  ')->trim();
// trimmed
```

### trimBeginning

[](#trimbeginning)

```
manipulate('  trimmed')->trimBeginning();
// trimmed
```

### trimEnd

[](#trimend)

```
manipulate('trimmed  ')->trimEnd();
// trimmed
```

### truncate($length = 100, $append = '...')

[](#truncatelength--100-append--)

```
manipulate('This is a sentence and will be truncated.')->truncate(10, '...');
// This is a ...
```

### urlDecode

[](#urldecode)

```
manipulate('hello%21')->urlDecode();
// hello!
```

### urlEncode

[](#urlencode)

```
manipulate('hello!')->urlEncode();
// hello%21
```

Chainable
---------

[](#chainable)

All of these methods (minus `toString`) can be chained.

```
manipulate('hello')->toUpper()->reverse();
// OLLEH
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 94.1% 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 ~1 days

Total

4

Last Release

3639d ago

Major Versions

v0.0.2 → v1.0.02016-07-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7c254290222b725ad4654ceaf2b0ec1624f84fe7882f6d2fd3f1aa865efb8b6?d=identicon)[SparksCoding](/maintainers/SparksCoding)

---

Top Contributors

[![mattsparks](https://avatars.githubusercontent.com/u/1678388?v=4)](https://github.com/mattsparks "mattsparks (16 commits)")[![NorcalAussie](https://avatars.githubusercontent.com/u/1586324?v=4)](https://github.com/NorcalAussie "NorcalAussie (1 commits)")

### Embed Badge

![Health badge](/badges/thestringler-laravel-manipulator/health.svg)

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

###  Alternatives

[dillingham/nova-detail-link

A Laravel Nova field.

22123.1k2](/packages/dillingham-nova-detail-link)

PHPackages © 2026

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