PHPackages                             ohseesoftware/laravel-assert-encrypted - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. ohseesoftware/laravel-assert-encrypted

ActiveLibrary[Testing &amp; Quality](/categories/testing)

ohseesoftware/laravel-assert-encrypted
======================================

Add an assertion to test for encrypted values in your database.

v1.2.1(5y ago)577.6k↑195.1%1[1 issues](https://github.com/ohseesoftware/laravel-assert-encrypted/issues)1MITPHPPHP &gt;=7.3CI failing

Since May 3Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ohseesoftware/laravel-assert-encrypted)[ Packagist](https://packagist.org/packages/ohseesoftware/laravel-assert-encrypted)[ Docs](https://github.com/ohseesoftware/laravel-assert-encrypted)[ RSS](/packages/ohseesoftware-laravel-assert-encrypted/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (4)Versions (9)Used By (1)

Laravel Assert Encrypted
========================

[](#laravel-assert-encrypted)

[![Current Release](https://camo.githubusercontent.com/b68a720d795aee921176c7ff45574f8a8d79fd35647a54ddee11050eb0348646/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6f68736565736f6674776172652f6c61726176656c2d6173736572742d656e637279707465642e7376673f7374796c653d666c61742d737175617265)](https://github.com/ohseesoftware/laravel-assert-encrypted/releases)[![Build Status Badge](https://github.com/ohseesoftware/laravel-assert-encrypted/workflows/Build/badge.svg)](https://github.com/ohseesoftware/laravel-assert-encrypted/workflows/Build/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/86efdc3e4a1d4bd0e658b7e2c9351f2ca0465f256613a6e5aaad8553aa86beec/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6f68736565736f6674776172652f6c61726176656c2d6173736572742d656e637279707465642f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/ohseesoftware/laravel-assert-encrypted?branch=master)[![Maintainability Score](https://camo.githubusercontent.com/868959ffd3aa9f76da3b42f26e82b238270d17dfbc8930509baadc3b22a826b7/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f6f68736565736f6674776172652f6c61726176656c2d6173736572742d656e637279707465642e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/ohseesoftware/laravel-assert-encrypted)[![Downloads](https://camo.githubusercontent.com/049162353ae3181308e3c66d381cdd7b6d60b19d7da59e2c496aea36727cdf9f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f68736565736f6674776172652f6c61726176656c2d6173736572742d656e637279707465642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ohseesoftware/laravel-assert-encrypted)[![MIT License](https://camo.githubusercontent.com/087fa8f39081c665eb6f9013752ae5fca477c7d887e420e7051cb66aef78cbe1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f68736565736f6674776172652f6c61726176656c2d6173736572742d656e637279707465642e7376673f7374796c653d666c61742d737175617265)](https://github.com/ohseesoftware/laravel-assert-encrypted/blob/master/LICENSE)

Add an assertion to test for encrypted values in your database.

Install
-------

[](#install)

```
composer require ohseesoftware/laravel-assert-encrypted

```

Usage
-----

[](#usage)

Say you have an encrypted value in your database:

```
User::create([
    'name' => 'John Doe',
    'secret' => encrypt('api-key')
]);
```

It's a bit hard to test the value of `secret` in the database because there's randomness in `encrypt()`. This means `encrypt('value') !== encrypt('value')`.

To get around this, you can use the trait exposed in this package in your tests:

```
