Download the PHP package sergkulich/laravel-key-rotate without Composer

On this page you can find all versions of the php package sergkulich/laravel-key-rotate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-key-rotate

Laravel Key Rotate

Latest Version on Packagist Total Downloads

Laravel Key Rotate package allows automatically copy current APP_KEY and update APP_PREVIOUS_KEYS with it, After that it will call key:generate artisan command to generate new APP_KEY, and, optionally, update all your Eloquent Models encrypted fields.

The Command available only then app()->runningInConsole() as it may take a while to update Models.

[!WARNING]

The package is in beta. Use with caution.

Never run in production without previous local testing and fresh .env copy and DB dump.

Table of contents

Installation

Install the package via composer:

Usage

Run artisan command to rotate the key.

Use --force option to run the command in production to avoid confirmation prompt.

Dive deeper

Quick example of extended usage.

You need to register KeyRotate::useListener() only if you want your model encrypted fields to be re-encrypted.

The Event

The key:rotate command fires an event after successful completion.

The Event Class

The package provides helper to get the event class name to subscribe listeners to it.

The Listener

The package provides default listener that update encrypted models fields after key rotation.

The Listener Class

The package provides helper to get the listener class name in case you need it.

Get Instance of the Listener

Simply subscribe the listener to the event in your app service provider boot method.

Or get singleton instance of the listener and call it anywhere in your code.

Models

The package discovers all Models in your app()->path() folder with app()->getNamespace() namespace.

But only then app()->runningInConsole(), so no unnecessary file scans happen during http requests.

Discover Models

It's possible to discover Models with defined namespace that are not located in your app()->path() but in a custom directory.

Include Models

It's possible to include Model to be updated with the listener without scanning directories.

Exclude Models

It's possible to exclude Model from being updated with the listener.

Exclude Model Fields

It's possible to exclude some Model fields from being updated with the listener.

Casts

By default, the listener takes care of Laravel's predefined encrypted Casts.

At your disposal there are helpers to reduce the above list or extend it with your custom cast that implements Castable, CastsAttributes, or CastsInboundAttributes interfaces.

Tests

Run the entire test suite:

Changelog

Please see CHANGELOG for more information.

Contributing

Please see CONTRIBUTING for more information.

License

The MIT License (MIT). Please see LICENSE for more information.


All versions of laravel-key-rotate with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sergkulich/laravel-key-rotate contains the following files

Loading the files please wait ....