PHPackages                             devkind/simple-laravel-encryptable - 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. devkind/simple-laravel-encryptable

ActiveLibrary[Security](/categories/security)

devkind/simple-laravel-encryptable
==================================

1.01(2y ago)03MITPHPPHP ^7.4|^8.0

Since Sep 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/devkindhq/simple-laravel-encryptable)[ Packagist](https://packagist.org/packages/devkind/simple-laravel-encryptable)[ Docs](https://github.com/devkindhq/simple-laravel-encryptable)[ RSS](/packages/devkind-simple-laravel-encryptable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Simple Laravel Encryptable
==========================

[](#simple-laravel-encryptable)

The Laravel Encryptable Attributes package provides seamless encryption and decryption of data stored in your database using Eloquent models. With this package, all values are automatically encrypted before storage and decrypted when queried, ensuring data security at rest while preserving accessibility.

[![Latest Version on Packagist](https://camo.githubusercontent.com/efec8ca0eb4a00e55487c31fd55ee3f03cab8a726e8cf0c9b1ce7012cc8a0d77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465766b696e6468712f73696d706c652d6c61726176656c2d656e637279707461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devkindhq/simple-laravel-encryptable)[![Total Downloads](https://camo.githubusercontent.com/7c5733d3713c4bf64816f572148dde1c1117bf00f3cc44da6d8f631b57ac18cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465766b696e6468712f73696d706c652d6c61726176656c2d656e637279707461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devkindhq/simple-laravel-encryptable)[![GitHub Actions](https://github.com/devkindhq/simple-laravel-encryptable/actions/workflows/main.yml/badge.svg)](https://github.com/devkindhq/simple-laravel-encryptable/actions/workflows/main.yml/badge.svg)

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

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

[](#installation)

You can install the package via composer:

```
composer require devkind/simple-laravel-encryptable
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Devkind\SimpleLaravelEncryptable\SimpleLaravelEncryptableServiceProvider" --tag="simple-encryptable"
```

Environment variables
---------------------

[](#environment-variables)

Here are the values which can be modified to tweek the encryption

N.B `ENCRYPTION_IV` is the important field that has to be set before using the package.

```
ENCRYPTION_KEY=
ENCRYPTION_CIPHER=
ENCRYPTION_IV=
ENCRYPTION_PREFIX=XXX

```

Usage
-----

[](#usage)

To use the package, just add the Encryptable trait to all model and the db column names in `$encryptable` you want to anonymize.

```
