PHPackages                             ceyleon/laravel-db-encrypter - 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. ceyleon/laravel-db-encrypter

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

ceyleon/laravel-db-encrypter
============================

Provides database model attribute encryption/decryption

v1.0.1(5y ago)0141MITPHPPHP &gt;=7.1

Since Aug 27Pushed 3y agoCompare

[ Source](https://github.com/ceyleon-devs/laravel-db-encrypter)[ Packagist](https://packagist.org/packages/ceyleon/laravel-db-encrypter)[ RSS](/packages/ceyleon-laravel-db-encrypter/feed)WikiDiscussions main Synced 3d ago

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

Laravel DB Encrypter Package
============================

[](#laravel-db-encrypter-package)

This package was created to encrypt and decrypt values of Eloquent model attributes.

Donnations
----------

[](#donnations)

If You think this package helped You, please donate. Thank You.

[https://www.paypal.com/cgi-bin/webscr?cmd=\_s-xclick&amp;hosted\_button\_id=SPYLWZ8Y5E4JE&amp;source=url](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SPYLWZ8Y5E4JE&source=url)

Key features
------------

[](#key-features)

- Encrypt, decrypt values stored in database fields
- Using standard Laravel's Crypt service
- Easy configuration

Requirements
------------

[](#requirements)

- Laravel: 6.0 and up
- PHP: 7.1 and newer

#### Database schema

[](#database-schema)

Encrypted values are stored as plain text so in most cases takes up more spaces then unencrypted one. Recommendation is to alter table column to `TEXT` type. If you want use `VARCHAR` or `CHAR` column type still you need to check if encrypted value fit.

#### Note:

[](#note)

Do not worry if you have current data in your database not encrypted and added column to `$encryptable` - they will return as is.
On save values will be encrypted and everything will work fine.

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

[](#installation)

Via Composer command line:

```
$ composer require ceyleon/laravel-db-encrypter
```

Usage
-----

[](#usage)

1. Use the `ceyleon\LaravelDbEncrypter\Traits\EncryptableDbAttribute` trait in any Eloquent model that you wish to use encryption
2. Define a `protected $encryptable` array containing a list of the encrypted attributes.

For example:

```

    use ceyleon\LaravelDbEncrypter\Traits\EncryptableDbAttribute;

    class Client extends Eloquent {
        use EncryptableDbAttribute;

        /** @var array The attributes that should be encrypted/decrypted */
        protected $encryptable = [
            'id_number',
            'email',
        ];
    }
```

3. You can use Laravel's original $casts to cast decrypted values

### License

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% 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 ~15 days

Total

2

Last Release

2068d ago

### Community

Maintainers

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

---

Top Contributors

[![betterapp](https://avatars.githubusercontent.com/u/7449124?v=4)](https://github.com/betterapp "betterapp (18 commits)")[![chaturadilan](https://avatars.githubusercontent.com/u/390081?v=4)](https://github.com/chaturadilan "chaturadilan (3 commits)")[![Thulaa123](https://avatars.githubusercontent.com/u/76616997?v=4)](https://github.com/Thulaa123 "Thulaa123 (2 commits)")[![rytisder](https://avatars.githubusercontent.com/u/17141616?v=4)](https://github.com/rytisder "rytisder (1 commits)")[![safly](https://avatars.githubusercontent.com/u/10373139?v=4)](https://github.com/safly "safly (1 commits)")[![vladkucherov](https://avatars.githubusercontent.com/u/4151984?v=4)](https://github.com/vladkucherov "vladkucherov (1 commits)")[![moebrowne](https://avatars.githubusercontent.com/u/8448512?v=4)](https://github.com/moebrowne "moebrowne (1 commits)")[![niqs87](https://avatars.githubusercontent.com/u/22177309?v=4)](https://github.com/niqs87 "niqs87 (1 commits)")

---

Tags

laravelencryptiondatabaseeloquentencryptdecryptattributedatabase encryptiondecryptionencrypterdecrypteddatabase encrypterlaravel db encryptionlaravel db encrypterlaravel database encryptionlaravel database encrypterlaravel model encryptionlaravel model encrypterlaravel attribute encrypterlaravel attribute encryption

### Embed Badge

![Health badge](/badges/ceyleon-laravel-db-encrypter/health.svg)

```
[![Health](https://phpackages.com/badges/ceyleon-laravel-db-encrypter/health.svg)](https://phpackages.com/packages/ceyleon-laravel-db-encrypter)
```

###  Alternatives

[betterapp/laravel-db-encrypter

Provides database model attribute encryption/decryption

365614.7k8](/packages/betterapp-laravel-db-encrypter)[delatbabel/elocryptfive

Automatically encrypt and decrypt Eloquent attributes with ease.

8493.0k](/packages/delatbabel-elocryptfive)[weebly/laravel-mutate

Mutate Laravel attributes

1354.7k](/packages/weebly-laravel-mutate)[dolphiq/laravel-aescrypt

AES encrypt and decrypt Eloquent attributes inspired by elocryptfive

171.7k](/packages/dolphiq-laravel-aescrypt)

PHPackages © 2026

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