PHPackages                             attakinsky/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. [Database &amp; ORM](/categories/database)
4. /
5. attakinsky/encryptable

ActiveLibrary[Database &amp; ORM](/categories/database)

attakinsky/encryptable
======================

It is a simple trait that allows you to encrypt and decrypt on the fly multiple fields in your Eloquent models.

1.0.0(6y ago)023MITPHP

Since Jun 5Pushed 6y agoCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

Encryptable
===========

[](#encryptable)

It is a simple trait that allows you to encrypt and decrypt on the fly multiple fields in your Eloquent models.

This is designed to solve what others can not do: decrypt the answers by API, especially in Lumen. It's not just another encryption package for Eloquent.

Install on Laravel/Lumen 5.5+
-----------------------------

[](#install-on-laravellumen-55)

```
composer require attakinsky/encryptable

```

Usage
-----

[](#usage)

1. Import on any model with `use Attakinsky\Encryptable\Encryptable`
2. Iclude the trait with `use Encryptable;`
3. Define an array named `$encryptable` with the fields that must be encrypted/decrypted.

Example:

```
