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.0k↓50%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 1mo ago

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

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

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

1010d 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-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[spatie/laravel-screenshot

Take screenshots of web pages in Laravel apps

7615.9k2](/packages/spatie-laravel-screenshot)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

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