PHPackages                             karaca-tech/string-mask - 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. karaca-tech/string-mask

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

karaca-tech/string-mask
=======================

v0.1.1(1y ago)83.7k↓33.3%2PHPPHP ^8.2

Since Sep 8Pushed 1y ago4 watchersCompare

[ Source](https://github.com/Karaca-Tech/string-mask)[ Packagist](https://packagist.org/packages/karaca-tech/string-mask)[ RSS](/packages/karaca-tech-string-mask/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (4)Used By (0)

[![](https://camo.githubusercontent.com/9ed449175fee1c3cd61dde652821f08ba54ceb913e1713f7e37243d003c7d872/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f537472696e674d61736b2e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6b61726163612d74656368253246737472696e672d6d61736b267061747465726e3d686964656f7574267374796c653d7374796c655f31266465736372697074696f6e3d412b73696d706c652b737472696e672b6d61736b6572266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313235707826696d616765733d6579652d6f6666)](https://camo.githubusercontent.com/9ed449175fee1c3cd61dde652821f08ba54ceb913e1713f7e37243d003c7d872/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f537472696e674d61736b2e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6b61726163612d74656368253246737472696e672d6d61736b267061747465726e3d686964656f7574267374796c653d7374796c655f31266465736372697074696f6e3d412b73696d706c652b737472696e672b6d61736b6572266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313235707826696d616765733d6579652d6f6666)

String Mask
===========

[](#string-mask)

[![Latest Version on Packagist](https://camo.githubusercontent.com/23dc3db32c6450554701b5488a6236ff0b581fffa7f6e522abd4e1f8bf090d56/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b61726163612d746563682f737472696e672d6d61736b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/karaca-tech/string-mask)[![GitHub Tests Action Status](https://camo.githubusercontent.com/98e49f309a50bfa36c5b46b9dbb6bedeee27c5cf8ccf882bd635622617e47e66/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b61726163612d746563682f737472696e672d6d61736b2f72756e2d74657374732e796d6c3f6c6162656c3d7465737473266272616e63683d6d61696e)](https://github.com/karaca-tech/string-mask/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Tests Action Status](https://camo.githubusercontent.com/78d0476b6aef181c10843710e2078b044ebdbf9a9ad0104bf33b9fc23590dc88/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b61726163612d746563682f737472696e672d6d61736b2f7374617469632d616e616c797369732e796d6c3f6c6162656c3d737461746963253230616e616c79736973266272616e63683d6d61696e)](https://github.com/karaca-tech/string-mask/actions?query=workflow%3Astatic-analysis+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/48cdfce27344686c4a433c0c5666f8ae503bc9372e097ad67767d5b116ec6e9b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b61726163612d746563682f737472696e672d6d61736b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/karaca-tech/string-mask)

This package is a simple string masker for Laravel.

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

[](#installation)

You can install the package via composer:

```
composer require karaca-tech/string-mask
```

Usage
-----

[](#usage)

```
use KaracaTech\StringMask\Facades\Mask;

mask('John Doe')->keepFirstAndLastCharacter()->apply(); // J******e

Mask::fullname('John Doe'); // J*** D**
Mask::initials('John Doe'); // J.D.

// Let's spice things up a little bit
Mask::of('John Doe')
    ->silent()
    ->eachWord()
    ->keepFirstWord()
    ->keepFirstCharacter()
    ->then(fn(Masker $masked) => $masked->append('.'))
    ->apply(); // John D.
```

### Using your own processors

[](#using-your-own-processors)

All processors must be extended from `KaracaTech\StringMask\Powder\Processor` abstract class.

```
use KaracaTech\StringMask\Powder\Processor;
use KaracaTech\StringMask\MaskTarget;

class MyProcessor extends Processor
{
    public function execute(MaskTarget $string): string
    {
        // Do your magic here
    }
}

// or

class ProcessorWithParams extends Processor
{
    public function __construct(private AnotherClass $anotherClass)
    {
    }

    public function execute(MaskTarget $string): string
    {
        // Do your magic here
    }
}
```

Then you can use your processor like this:

```
Mask::of('John Doe')
    ->using(MyProcessor::class)
    ->using(MyOtherProcessor::class)
    ->using(ProcessorWithParams::class, new AnotherClass())
    ->apply();
```

For further examples, please check out the `KaracaTech\StringMask\Concerete\Processors` namespace.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Contributions are always welcome, [thanks to all of our contributors](https://github.com/Karaca-Tech/string-mask/graphs/contributors)!

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.4% 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 ~193 days

Total

3

Last Release

597d ago

### Community

Maintainers

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

---

Top Contributors

[![uutkukorkmaz](https://avatars.githubusercontent.com/u/19177587?v=4)](https://github.com/uutkukorkmaz "uutkukorkmaz (13 commits)")[![mcucen](https://avatars.githubusercontent.com/u/18099064?v=4)](https://github.com/mcucen "mcucen (5 commits)")[![onursimsek](https://avatars.githubusercontent.com/u/1241396?v=4)](https://github.com/onursimsek "onursimsek (1 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/karaca-tech-string-mask/health.svg)

```
[![Health](https://phpackages.com/badges/karaca-tech-string-mask/health.svg)](https://phpackages.com/packages/karaca-tech-string-mask)
```

###  Alternatives

[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[tonysm/rich-text-laravel

Integrates Trix content with Laravel

46577.8k1](/packages/tonysm-rich-text-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[spatie/laravel-screenshot

Take screenshots of web pages in Laravel apps

7615.9k2](/packages/spatie-laravel-screenshot)[joaopaulolndev/filament-world-clock

Show hours around the world by timezone

3111.9k](/packages/joaopaulolndev-filament-world-clock)[tonegabes/filament-better-options

Filament form components for better radio and checkbox options.

155.2k](/packages/tonegabes-filament-better-options)

PHPackages © 2026

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