Usage

Models

{note} You're browsing the documentation for an old version of laravel-app-key-rotator. Consider upgrading your project to v3. Check your version with the following command:

composer show rawilk/laravel-app-key-rotator

If you have models that need to have data re-encrypted with the new app key, you can specify them in the models key in the config/app-key-rotator.php config file. Specify the model class, and then an array of fields that are encrypted in the database.

'models' => [
    \App\User::class => [
        'birth_date',
        'bank_account',
    ],
    \App\Student::class => [
        'email',
    ],
],

To help with memory issues that could cause fatal errors in larger databases, the action that re-encrypts your models uses chunking to process your records in chunks. The default is 500, but you can change this to fit your needs in the config file.

Previous
Basic Usage
Caught a mistake? Suggest an edit on GitHub