Download the PHP package joelwmale/laravel-encryption without Composer
On this page you can find all versions of the php package joelwmale/laravel-encryption. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download joelwmale/laravel-encryption
More information about joelwmale/laravel-encryption
Files in joelwmale/laravel-encryption
Package laravel-encryption
Short Description A package to easily encrypt & decrypt model fields in Laravel using OpenSSL.
License MIT
Homepage https://github.com/joelwmale/laravel-encryption
Informations about the package laravel-encryption
Laravel Encryption
A package to easily encrypt & decrypt model fields in Laravel using OpenSSL.
Key Features
- Encrypt and decrypt module attributes easily
- Minimal configuration
- Comes with a selection of eloquent builders for easy queries
- Growing support for casting encryptable data
Installation
You can install the package via composer:
Usage
Configuration
Publshing The Configuration
The configuration file looks like this:
If you need to make any changes to the configuration, feel free to publish the configuration file.
Configure Model Attributes To Be Encrypted
This package will only encrypt fields within the $encryptableAttributes
array, leaving the rest of the model unencrypted and untouched.
This is useful for scenarios where compliance only requires you encrypting specific values and not your entire database.
Casting Encrypted Values
Due to the fact that encrypted values can be quite long, you will need to store them as text
fields, meaning you have to give way to native column types.
Also due to the way Laravel handles casting (and the priority it takes) you cannot right now use native casts with encrypted fields.
So we use our own array to determine what fields should be casted to what:
Supported casts
Cast support is still growing, and will be added as time goes on.
- date
- datetime
- json
Testing
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-encryption with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0
nesbot/carbon Version ^2.71
ext-json Version *