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

ActiveLibrary[Security](/categories/security)

chriswillerton/encryptable
==========================

Trait for use with Laravel 5 models allowing easy encryption/decryption of attributes.

1.0.0(8y ago)237MITPHPPHP &gt;=5.6.0

Since Nov 15Pushed 8y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

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

[](#encryptable)

A trait for use with Laravel 5 models allowing easy encryption/decryption of attributes.

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

[](#installation)

Add the following to the `composer.json` file in your project:

```
"chriswillerton/encryptable": "1.*"

```

or you can run the below on the command line in the root of your project:

```
composer require "chriswillerton/encryptable" "1.*"

```

Setup
-----

[](#setup)

To get started, add the trait to the model.

You also need to add an array detailing which attributes should be encrypted. Add this as a property on your model called `$encryptedAttributes`.

```
use ChrisWillerton\Encryptable\Encryptable;

class YourModel extends Eloquent
{
    use Encryptable;

    protected $encryptedAttributes = [
        'first_name',
        'surname',
        'email_address'
    ];

```

Notes
-----

[](#notes)

As this uses the encryption that ships with Laravel, **please ensure you have set an app key before using this**, otherwise your encrypted attributes will not be secure. Additionally, do not lose your app key, or you will not be able to decrypt your attributes.

Any issues decrypting attributes will be added to the Laravel log file, so if things aren't working as expected then check here first for details about the problem.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3150d ago

### Community

Maintainers

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

---

Top Contributors

[![ChrisWillerton](https://avatars.githubusercontent.com/u/4704987?v=4)](https://github.com/ChrisWillerton "ChrisWillerton (6 commits)")

---

Tags

laravelencryptionmodel

### Embed Badge

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

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

###  Alternatives

[thomaswelton/laravel-mcrypt-faker

Allows installation of Laravel where the PHP Mcrypt extension is not available. Provides encryption using OpenSSL, or by disabling encryption entierly.

114.0k](/packages/thomaswelton-laravel-mcrypt-faker)

PHPackages © 2026

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