PHPackages                             rawilk/laravel-app-key-rotator - 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. rawilk/laravel-app-key-rotator

ActiveLibrary[Security](/categories/security)

rawilk/laravel-app-key-rotator
==============================

Rotate app keys around while re-encrypting data.

v3.1.1(3y ago)2311.4k2[1 issues](https://github.com/rawilk/laravel-app-key-rotator/issues)[1 PRs](https://github.com/rawilk/laravel-app-key-rotator/pulls)MITPHPPHP ^8.0|^8.1|^8.2

Since Jul 23Pushed 1y ago2 watchersCompare

[ Source](https://github.com/rawilk/laravel-app-key-rotator)[ Packagist](https://packagist.org/packages/rawilk/laravel-app-key-rotator)[ Docs](https://github.com/rawilk/laravel-app-key-rotator)[ GitHub Sponsors](https://github.com/rawilk)[ RSS](/packages/rawilk-laravel-app-key-rotator/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (6)Dependencies (8)Versions (10)Used By (0)

App Key Rotator for Laravel
===========================

[](#app-key-rotator-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d4f99e378a48ed9c37a190a6c0fc1db3ea5741a9af6ac12959a50e57cab38a91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726177696c6b2f6c61726176656c2d6170702d6b65792d726f7461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rawilk/laravel-app-key-rotator)[![Tests](https://github.com/rawilk/laravel-app-key-rotator/workflows/Tests/badge.svg)](https://github.com/rawilk/laravel-app-key-rotator/workflows/Tests/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/2c87c1ea8dc67dc443e6dd01443f77562ffa8d5e44c8ee9bcfb3bb15d12fffe9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726177696c6b2f6c61726176656c2d6170702d6b65792d726f7461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rawilk/laravel-app-key-rotator)[![PHP from Packagist](https://camo.githubusercontent.com/436b4c06795a4b4f53d254475fad904759d835fc2fa5fc9c6c9bfe57df3b93fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f726177696c6b2f6c61726176656c2d6170702d6b65792d726f7461746f723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rawilk/laravel-app-key-rotator)[![License](https://camo.githubusercontent.com/f87e0fd3c24a5b2fd8b2c3da155238a034a04d1d098534b9ea6a259c0afa462d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f726177696c6b2f6c61726176656c2d6170702d6b65792d726f7461746f723f7374796c653d666c61742d737175617265)](https://github.com/rawilk/laravel-app-key-rotator/blob/main/LICENSE.md)

[![Social image](https://camo.githubusercontent.com/ab7b2a410f8175ef71553dcdf68d7ba0e8da724ff5a92a06767ec21206c8912c/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f6c61726176656c2d6170702d6b65792d726f7461746f722e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d726177696c6b2532466c61726176656c2d6170702d6b65792d726f7461746f72267061747465726e3d656e646c657373436c6f756473267374796c653d7374796c655f31266465736372697074696f6e3d526f746174652b6170702b6b6579732b61726f756e642b7768696c652b72652d656e6372797074696e672b646174612e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d72656672657368)](https://camo.githubusercontent.com/ab7b2a410f8175ef71553dcdf68d7ba0e8da724ff5a92a06767ec21206c8912c/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f6c61726176656c2d6170702d6b65792d726f7461746f722e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d726177696c6b2532466c61726176656c2d6170702d6b65792d726f7461746f72267061747465726e3d656e646c657373436c6f756473267374796c653d7374796c655f31266465736372697074696f6e3d526f746174652b6170702b6b6579732b61726f756e642b7768696c652b72652d656e6372797074696e672b646174612e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d72656672657368)

Changing your `APP_KEY` can be as simple as running `php artisan key:generate`, but what about your encrypted model data? This is where Laravel App Key Rotator comes in. This package can help with generating a new app key for you, as well as decrypting and re-encrypting your model automatically for you through an artisan command.

It's also generally a good practice to rotate your app keys periodically (e.g. every 6 months) or when certain events happen, such as an employee leaving the company. See more information here:

Basic Usage
-----------

[](#basic-usage)

Rotating your app keys is as simple as running this artisan command:

```
php artisan app-key-rotator:rotate
```

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

[](#installation)

You can install the package via composer:

```
composer require rawilk/laravel-app-key-rotator
```

You can publish the config file with:

```
php artisan vendor:publish --tag="app-key-rotator-config"
```

You can view the default configuration file here:

Documentation
-------------

[](#documentation)

For documentation, please visit:

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Randall Wilk](https://github.com/rawilk)
- [All Contributors](../../contributors)

Disclaimer
----------

[](#disclaimer)

This package is not affiliated with, maintained, authorized, endorsed or sponsored by Laravel or any of its affiliates.

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 78.3% 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 ~138 days

Recently: every ~32 days

Total

8

Last Release

1153d ago

Major Versions

1.0.0 → 2.0.02020-09-09

v2.0.1 → v3.0.02022-11-07

PHP version history (4 changes)1.0.0PHP ^7.4

v2.0.1PHP ^7.4|^8.0|^8.1

v3.0.0PHP ^8.0|^8.1

v3.1.1PHP ^8.0|^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e2f599d4d290bbb514a933d4f21c3f18fb093f5f8a9994cb17f5469853c749c?d=identicon)[rawilk](/maintainers/rawilk)

---

Top Contributors

[![rawilk](https://avatars.githubusercontent.com/u/22842525?v=4)](https://github.com/rawilk "rawilk (90 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (15 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (10 commits)")

---

Tags

rawilklaravel-app-key-rotatorapp key

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/rawilk-laravel-app-key-rotator/health.svg)

```
[![Health](https://phpackages.com/badges/rawilk-laravel-app-key-rotator/health.svg)](https://phpackages.com/packages/rawilk-laravel-app-key-rotator)
```

###  Alternatives

[spatie/laravel-csp

Add CSP headers to the responses of a Laravel app

8519.6M19](/packages/spatie-laravel-csp)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)[spatie/laravel-ciphersweet

Use ciphersweet in your Laravel project

416718.4k1](/packages/spatie-laravel-ciphersweet)[tzsk/otp

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[genealabs/laravel-governor

Managing policy and control in Laravel.

201262.8k](/packages/genealabs-laravel-governor)[dgtlss/warden

A Laravel package that proactively monitors your dependencies for security vulnerabilities by running automated composer audits and sending notifications via webhooks and email

8745.6k](/packages/dgtlss-warden)

PHPackages © 2026

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