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

AbandonedArchivedLibrary[Security](/categories/security)

njhyuk/laravel-encryptable
==========================

Laravel eloquent automatic encryption and decryption using mysql AES function.

212PHP

Since Jan 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/njhyuk/laravel-encryptable)[ Packagist](https://packagist.org/packages/njhyuk/laravel-encryptable)[ RSS](/packages/njhyuk-laravel-encryptable/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Encryptable
===================

[](#laravel-encryptable)

Automatically encrypt Laravel Eloquent Model columns using Mysql AES functions.

It is possible to database search because it uses Mysql AES functions.

Notice
------

[](#notice)

Mysql AES functions do not use initialization vectors.

If you give up searching in Mysql, it is better to use a different solution.

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

[](#installation)

### Installing the package

[](#installing-the-package)

```
composer require njhyuk/laravel-encryptable

```

### Configuring the package

[](#configuring-the-package)

```
 php artisan vendor:publish --provider="Njhyuk\LaravelEncryptable\EncryptableProvider"

```

### Add encryption key in env file

[](#add-encryption-key-in-env-file)

```
ENCRYPTABLE_KEY=SetYour16ByteKey

```

Usage
-----

[](#usage)

### Specify the model's encryption columns

[](#specify-the-models-encryption-columns)

Use the `Njhyuk\LaravelEncryptable\Encryptable` trait and add columns to be encrypted.

```
