PHPackages                             spekulatius/laravel-powertools - 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. spekulatius/laravel-powertools

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

spekulatius/laravel-powertools
==============================

A personal collection of Laravel Helpers, my powertools.

0.3.2(2y ago)31.1k↓93.8%1[1 PRs](https://github.com/spekulatius/laravel-powertools/pulls)MITPHPPHP ^8.1

Since Mar 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/spekulatius/laravel-powertools)[ Packagist](https://packagist.org/packages/spekulatius/laravel-powertools)[ Docs](https://github.com/spekulatius/laravel-powertools)[ Fund](https://www.buymeacoffee.com/spekulatius)[ GitHub Sponsors](https://github.com/spekulatius)[ RSS](/packages/spekulatius-laravel-powertools/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (13)Versions (7)Used By (0)

A personal collection of Laravel Helpers, my powertools.
========================================================

[](#a-personal-collection-of-laravel-helpers-my-powertools)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a4d5d935879ac3de3f06bb0426000c6723db2af4c6a13630b7b3df6820ef3855/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370656b756c61746975732f6c61726176656c2d706f776572746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spekulatius/laravel-powertools)[![GitHub Tests Action Status](https://camo.githubusercontent.com/3810fc46124e4e9585215b058a33dc60bf1a5d8e9a8c9bff30faaad12ab6ae55/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370656b756c61746975732f6c61726176656c2d706f776572746f6f6c732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/spekulatius/laravel-powertools/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/97e0b805ad189b51e4546c8c7abd66bda33da9464fffaaefde91e6f4283b298c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370656b756c61746975732f6c61726176656c2d706f776572746f6f6c732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/spekulatius/laravel-powertools/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/f15666b39774a95b6819cca8eb84bfe0687985360a86f158583b5b691c903b37/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370656b756c61746975732f6c61726176656c2d706f776572746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spekulatius/laravel-powertools)

This is a personal collection of handy helpers, tools, and utilities that I've used across various Laravel projects. However, please note that these are intended for personal use and development, so please use at your own risk.

Features
--------

[](#features)

### `maskSensitiveData`: Collection Makro to mask sensitive data

[](#masksensitivedata-collection-makro-to-mask-sensitive-data)

`maskSensitiveData` Laravel Collection macro and provides the functionality to mask sensitive data in a collection. The macro prepares masked fields regular expressions for use, and applies the mask to the sensitive data based on the regexes and custom fields. It maps over the collection and replaces any data matching the regular expressions with a mask value of `[masked]`. This functionality is useful when dealing with collections of sensitive data and is designed to keep the sensitive data secure.

Usage:

```
collect(['password' => 'this really should not be logged...'])
  ->maskSensitiveData()
  ->toArray();

// 'password' => '[masked]'
```

### `ToLog`: Model Trait to log context

[](#tolog-model-trait-to-log-context)

The `ToLog` trait is a simple trait to add to models that allows you to summarize model data as logging context. It's essentially a slimmed-down version of the `->toArray()` method, and it's meant to be used in a similar approach similar to `\Log::error('....', $entry->toLog());`. Already runs `maskSensitiveData` by design.

### `SelfDeletingTemporaryDirectory`

[](#selfdeletingtemporarydirectory)

An extension of [`Spaties TemporaryDirectory`](https://github.com/spatie/temporary-directory) to delete itself after 120 minutes (configurable).

```
use Spekulatius\LaravelPowertools\Helpers\SelfDeletingTemporaryDirectory;

// ...

$tempDir = new SelfDeletingTemporaryDirectory;

// use like TemporaryDirectory from Spatie.
```

My common way to use this:

```
$tempFile = (new SelfDeletingTemporaryDirectory)->create()->path('temp.zip');
```

Compatibility
-------------

[](#compatibility)

This project has been tested on Laravel 10 using PHP 8.1 or 8.2. It should work on Laravel 9 as well, although it has not been tested on that version.

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

[](#installation)

You can install the package via composer:

```
composer require spekulatius/laravel-powertools
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-powertools-config"
```

Testing
-------

[](#testing)

The project is roughly tested on Laravel 10.

```
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)

- [Peter Thaleikis](https://github.com/spekulatius)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~33 days

Total

5

Last Release

1062d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8433587?v=4)[Peter Thaleikis](/maintainers/spekulatius)[@spekulatius](https://github.com/spekulatius)

---

Top Contributors

[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (11 commits)")

---

Tags

application-hardeninginfoseclaravellegacy-codetoolkitlaravelLaravel Utilitiesspekulatiuslaravel-powertools

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/spekulatius-laravel-powertools/health.svg)

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

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

213421.0k2](/packages/wnx-laravel-backup-restore)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[finller/laravel-media

A flexible media library for Laravel

472.1k](/packages/finller-laravel-media)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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