PHPackages                             paragonie/eloquent-ciphersweet - 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. paragonie/eloquent-ciphersweet

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

paragonie/eloquent-ciphersweet
==============================

Provides searchable encrypted columns for Eloquent ORM

v0.1.0(7mo ago)132078ISCPHPPHP ^8.3CI failing

Since Oct 1Pushed 7mo ago4 watchersCompare

[ Source](https://github.com/paragonie/eloquent-ciphersweet)[ Packagist](https://packagist.org/packages/paragonie/eloquent-ciphersweet)[ RSS](/packages/paragonie-eloquent-ciphersweet/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (9)Versions (3)Used By (0)

Eloquent-CipherSweet Adapter
============================

[](#eloquent-ciphersweet-adapter)

[![Build Status](https://github.com/paragonie/eloquent-ciphersweet/actions/workflows/ci.yml/badge.svg)](https://github.com/paragonie/eloquent-ciphersweet/actions)[![Example App](https://github.com/paragonie/eloquent-ciphersweet/actions/workflows/example-app.yml/badge.svg)](https://github.com/paragonie/eloquent-ciphersweet/tree/main/docs/example-app)[![Latest Stable Version](https://camo.githubusercontent.com/8139fcadfa37da46c76117f66656aea9ee1562fdd161e22e44ac20045f2c300a/68747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f656c6f7175656e742d63697068657273776565742f762f737461626c65)](https://packagist.org/packages/paragonie/eloquent-ciphersweet)[![Latest Unstable Version](https://camo.githubusercontent.com/e94a17c5f8f4c6019dcf90eea2dd192723e8aea54c2b356c2feb0b575f53ece0/68747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f656c6f7175656e742d63697068657273776565742f762f756e737461626c65)](https://packagist.org/packages/paragonie/eloquent-ciphersweet)[![License](https://camo.githubusercontent.com/733458549be35c47f54fe9de4f261fb0d50317cbb30ee520f884fd7aec10a6bd/68747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f656c6f7175656e742d63697068657273776565742f6c6963656e7365)](https://packagist.org/packages/paragonie/eloquent-ciphersweet)[![Downloads](https://camo.githubusercontent.com/295552e67583f1402d57e9be06227c3f09574c54fcc7be2d98b45a5524baa7d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70617261676f6e69652f656c6f7175656e742d63697068657273776565742e737667)](https://packagist.org/packages/paragonie/eloquent-ciphersweet)

---

This library allows for [searchable encryption](https://paragonie.com/blog/2017/05/building-searchable-encrypted-databases-with-php-and-sql)in Eloquent ORM models.

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

[](#installation)

This adapter can be installed through Composer:

```
composer require paragonie/eloquent-ciphersweet
```

We do not support non-Composer use-cases with this adapter library.

Configuration
-------------

[](#configuration)

Once you've installed, publish `config/ciphersweet.php` with `php artisan vendor:publish` and then run the following artisan command to set your key.

```
php artisan ciphersweet:generate:key

```

Once the configuration is done, you can begin using encrypted fields in your models.

There are two ways to achieve this effect:

### EncryptedFieldModel Base Class

[](#encryptedfieldmodel-base-class)

The easiest way to use the features of the adapter is to ensure your models extend `EncryptedFieldModel` instead of the base `Model`.

```
