samasend/laravel-key-rotate 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

samasend/laravel-key-rotate

最新稳定版本:v1.0.0

Composer 安装命令:

composer require samasend/laravel-key-rotate

包简介

Rotate your Laravel application key with ease

README 文档

README

Github Actions Total Downloads Latest Stable Version License

Laravel Key Rotate is a package that extends Laravel's built-in key:generate command, providing a simple and efficient way to rotate your Laravel application's key.

This is particularly useful for maintaining the security and integrity of your application by ensuring that the encryption key is regularly updated.

Prerequisites

  • PHP >= 8.2
  • Laravel >= 11.x

Installation

You can install the package via composer:

composer require samasend/laravel-key-rotate

Usage

To rotate your application key, simply run the following artisan command:

php artisan key:rotate

This command will generate a new application key and update your .env file. The previous key will be stored in the APP_PREVIOUS_KEYS environment variable, allowing for graceful key rotation.

How It Works

The key:rotate command extends Laravel's built-in key:generate command. When run, it generates a new application key as usual. However, instead of simply replacing the old key, it stores the old key in the APP_PREVIOUS_KEYS environment variable. This allows for a smooth transition to the new key, as the old key is still available for decrypting any data that was encrypted with it.

Ideally, this feature should have been implemented in Laravel core, but it's not. So, this package is here to help you.

License

This package is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 1.31k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-30