PHPackages                             kduma/eloquent-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. kduma/eloquent-encryptable

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

kduma/eloquent-encryptable
==========================

Adds possibility to encrypt fields in Laravel Eloquent models.

v1.3.0(1y ago)52.1k[1 issues](https://github.com/kduma-OSS/LV-eloquent-encryptable/issues)MITPHPPHP &gt;=7.4

Since Jan 31Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/kduma-OSS/LV-eloquent-encryptable)[ Packagist](https://packagist.org/packages/kduma/eloquent-encryptable)[ RSS](/packages/kduma-eloquent-encryptable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (11)Used By (0)

L5-eloquent-encryptable
=======================

[](#l5-eloquent-encryptable)

[![Latest Stable Version](https://camo.githubusercontent.com/edb53814cbec5fe67bc10d6c011d490f3977f65c78cb66717a2dd1371b73cd0b/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d656e637279707461626c652f762f737461626c652e737667)](https://packagist.org/packages/kduma/eloquent-encryptable)[![Total Downloads](https://camo.githubusercontent.com/daf30e5e95f0d99757f09e5fa0403f2bdd724a6a7b00b742dd50aeee397fc939/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d656e637279707461626c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/kduma/eloquent-encryptable)[![Latest Unstable Version](https://camo.githubusercontent.com/1a5494c0293a2660edc8599f63f78adbf0f7cfd7cfa19f7e34f5c06973daaa28/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d656e637279707461626c652f762f756e737461626c652e737667)](https://packagist.org/packages/kduma/eloquent-encryptable)[![License](https://camo.githubusercontent.com/3f44f8c19ad9a2e006021709aff0fd4c2e1119a7016ba3cc90ae303fd3eea2e1/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d656e637279707461626c652f6c6963656e73652e737667)](https://packagist.org/packages/kduma/eloquent-encryptable)[![SensioLabsInsight](https://camo.githubusercontent.com/68c12c189847da8567c22ae4d85ebec21b018cf0d571e679371c2592392f3564/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62323439376666632d663537352d346562302d623034612d3233303732633534613535322f6d696e692e706e67)](https://insight.sensiolabs.com/projects/b2497ffc-f575-4eb0-b04a-23072c54a552)[![StyleCI](https://camo.githubusercontent.com/91dca32a101c5e53a75791706937a20c20b26f79b1fc8b362bccc026a390149d/68747470733a2f2f7374796c6563692e696f2f7265706f732f33303130323935382f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/30102958)

Adds possibility to encrypt fields in Laravel Eloquent models.

Check full documentation here: [opensource.duma.sh/libraries/php/eloquent-encryptable](https://opensource.duma.sh/libraries/php/eloquent-encryptable)

Setup
=====

[](#setup)

Add the package to the require section of your composer.json and run `composer update`

```
"kduma/eloquent-encryptable": "^1.1"

```

Prepare models
==============

[](#prepare-models)

In your model add following lines:

```
use \KDuma\Eloquent\Encryptable;
protected $encrypted=['list', 'of', 'fields', 'you', 'wan\'t', 'to', 'encrypt'];

```

Usage
=====

[](#usage)

It will be automaticly encrypting and decrypting fields defined in `$encrypted` property of your model.

Those fields must be `string` or `text` for longer values.

YOTTARAM
========

[](#yottaram)

A special thanks to [Jonathan Stavis](http://yottaram.com/blog/2014/10/24/encrypting-eloquent-models/), an original code creator that this package is based on.

Packagist
=========

[](#packagist)

View this package on Packagist.org: [kduma/eloquent-encryptable](https://packagist.org/packages/kduma/eloquent-encryptable)

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance46

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~446 days

Recently: every ~860 days

Total

9

Last Release

547d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.4.0

v1.1.2PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/d09451622719c7efce1a7971b8e5a875859504882ba2b8c279d1015a99e8f12c?d=identicon)[kduma](/maintainers/kduma)

---

Top Contributors

[![kduma](https://avatars.githubusercontent.com/u/1062582?v=4)](https://github.com/kduma "kduma (30 commits)")[![lukepolo](https://avatars.githubusercontent.com/u/2066668?v=4)](https://github.com/lukepolo "lukepolo (3 commits)")

---

Tags

laravelphplaraveleloquentencryptencodecrypt

### Embed Badge

![Health badge](/badges/kduma-eloquent-encryptable/health.svg)

```
[![Health](https://phpackages.com/badges/kduma-eloquent-encryptable/health.svg)](https://phpackages.com/packages/kduma-eloquent-encryptable)
```

###  Alternatives

[silber/bouncer

Eloquent roles and abilities.

3.6k4.4M25](/packages/silber-bouncer)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
