PHPackages                             kielabokkie/laravel-conceal - 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. [Security](/categories/security)
4. /
5. kielabokkie/laravel-conceal

ActiveLibrary[Security](/categories/security)

kielabokkie/laravel-conceal
===========================

Conceal data in an array or collection

v1.4.0(4y ago)233.1k21MITPHPPHP ^7.2|^8.0CI failing

Since Jan 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/kielabokkie/laravel-conceal)[ Packagist](https://packagist.org/packages/kielabokkie/laravel-conceal)[ RSS](/packages/kielabokkie-laravel-conceal/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (2)Versions (9)Used By (1)

Laravel Conceal
===============

[](#laravel-conceal)

[![Author](https://camo.githubusercontent.com/9bd4336b32dfdf89be48fc04f379fcce3b7fadc848a9481232ad8e7c10ff47b8/687474703a2f2f696d672e736869656c64732e696f2f62616467652f62792d406b69656c61626f6b6b69652d6c69676874677265792e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/kielabokkie)[![Build](https://camo.githubusercontent.com/07fd74be2cd923f6a3824ccb1afa68536fba21bc0f4cdf75da3acc75f0bc89f3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6b69656c61626f6b6b69652f6c61726176656c2d636f6e6365616c2f72756e2d74657374732f6d61737465723f7374796c653d666c61742d737175617265)](https://github.com/kielabokkie/laravel-conceal/actions)[![Packagist Version](https://camo.githubusercontent.com/1af4b6aacac2eaa1772e475eec66509fb0f4beca0c8e368b4a62e981f6ab42ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b69656c61626f6b6b69652f6c61726176656c2d636f6e6365616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kielabokkie/laravel-conceal)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This package allows you to conceal sensitive data in arrays and collections. This is particularly useful when writing possibly sensitive data to log files.

Once installed you can do things like this:

```
$data = [
    'username' => 'wouter',
    'api_key' => 'secret'
];

$hide = ['api_key'];

$output = conceal($data, $hide);
print_r($output);

// Outputs: ['username' => 'wouter', 'api_key' => '********']
```

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2
- Laravel 5.7+ | 6 | 7 | 8

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

[](#installation)

Install the package via composer:

```
composer require kielabokkie/laravel-conceal

```

Package configuration
---------------------

[](#package-configuration)

This package has minimal configuration. All you can do at the moment is set the keys that are concealed by default. If you want to add your own defaults you can do that by publishing the config file by running the following command:

```
php artisan vendor:publish --provider="Kielabokkie\LaravelConceal\ConcealServiceProvider"
```

These are the contents of the file that will be published at `config/conceal.php`:

```
return [
    /*
     * Array of keys that will be concealed automatically.
     */
    'defaults' => [
        'password',
        'password_confirmation',
    ]
];
```

Usage
-----

[](#usage)

Use the default configuration to conceal the password:

```
$data = [
    'username' => 'wouter',
    'password' => 'secret'
];

$output = conceal($data);
print_r($output);

// Outputs: ['username' => 'wouter', 'password' => '********']
```

Set keys on the fly:

```
$data = [
    'api_key' => 'secret'
];

$output = conceal($data, ['api_key']);
print_r($output);

// Outputs: ['api_key' => '********']
```

Everything works exactly the same for collections:

```
$data = new Collection([
    'username' => 'wouter',
    'password' => 'secret'
]);

$output = conceal($data);
print_r($output->toArray());

// Outputs: ['username' => 'wouter', 'password' => '********']
```

And last but not least, it works recursively too:

```
$data = [
    'password' => 'secret',
    'nextlevel' => [
        'password' => 'secret',
    ]
];

$output = conceal($data);
print_r($output);

// Outputs: ['password' => '********', 'nextlevel' => ['password' => '********']]
```

### Facade

[](#facade)

The examples above use the `conceal()` helper function. If Facades are more your thing you can use that instead:

```
use Kielabokkie\LaravelConceal\Facades\Concealer;

$data = [
    'password' => 'secret'
];

$output = Concealer::conceal($data);
print_r($output);

// Outputs: ['password' => '********']
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 95.5% 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 ~101 days

Recently: every ~148 days

Total

8

Last Release

1641d ago

PHP version history (3 changes)v1.0.0PHP ^7.1

v1.3.0PHP ^7.2

v1.4.0PHP ^7.2|^8.0

### Community

Maintainers

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

---

Top Contributors

[![kielabokkie](https://avatars.githubusercontent.com/u/1221750?v=4)](https://github.com/kielabokkie "kielabokkie (21 commits)")[![craigmccreath](https://avatars.githubusercontent.com/u/440657?v=4)](https://github.com/craigmccreath "craigmccreath (1 commits)")

---

Tags

composer-packageconceal-datalaravellaravel-packagesecuritysensitive-data

### Embed Badge

![Health badge](/badges/kielabokkie-laravel-conceal/health.svg)

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

###  Alternatives

[illuminate/encryption

The Illuminate Encryption package.

9630.7M327](/packages/illuminate-encryption)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)

PHPackages © 2026

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