PHPackages                             managefaster/database - 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. managefaster/database

ActiveLibrary

managefaster/database
=====================

Override model base eloquent and database functionality with encrypt function and uuid

v1.1.3(2y ago)041MITPHPPHP ^8.0.2

Since Dec 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ManageFaster/Database)[ Packagist](https://packagist.org/packages/managefaster/database)[ RSS](/packages/managefaster-database/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (8)Used By (0)

Database encrypt v1.1.0
=======================

[](#database-encrypt-v110)

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

[](#installation)

```
Run command: composer require managefaster/database

Add provider: Managefaster\Database\DatabaseServiceProvider::class at root_folder/config/app.php

```

Environment variables example
-----------------------------

[](#environment-variables-example)

```
ENCRYPT_KEY=random_string
ENCRYPT_ATTRIBUTE="HEX(N'%s', '%s')"
DECRYPT_KEY="CONVERT(HEX(%s), '%s') USING UTF8)"
DECRYPT_ATTRIBUTE="HEX('%s', '%s')"

```

Instruction
-----------

[](#instruction)

```
*** Model ***
To use database encryt model must extend EncryptModel EncryptModel

use Managefaster\Database\Abstract\EncryptModel;

class TestModel extends EncryptModel
{
    //
}

*** Model with laravel authentication ***
Replace Authenticatable with AuthEncryptModel

use Managefaster\Database\Abstract\AuthEncryptModel;

class User extends AuthEncryptModel
{
    //
}

*** Model with uuid ***
When models use uuid as a primary key need extend UuidEncryptModel class and get

use Managefaster\Database\Abstract\UuidEncryptModel;

class TestModel extends UuidEncryptModel
{
    //
}

*** Model with uuid and laravel authentication ***
When models use uuid as a primary key and has laravel authentication need extend AuthEncryptModel class and get

use Managefaster\Database\Abstract\AuthEncryptModel;

class User extends UuidAuthEncryptModel
{
    //
}

```

```
*** Set encrypt columns for model ***

protected array $encrypts = ['title'];

```

Model (create, update)
----------------------

[](#model-create-update)

```
Create and update method work like default laravel methods, and automaticaly encrypt values by specified columsn in model encrypts property

TestModel::create(['title' => $title]);
TestModel::find($id)->update(['title' => $title]);

```

Query examples
--------------

[](#query-examples)

```
TestModel::whereEncrypted([
        ['title', '!=', 'Test title 1701517522'],
        ['title', 'Test title 1701517493']
    ])
    ->orWhereEncrypted([
        ['title', '!=', 'Test title 1701517522'],
        ['title', 'Test title 1701517493']
    ])
    ->where('slug', 'test-title-1701335036')
    ->whereEncrypted('title', 'LIKE', '%' . 'test 2' . '%')
    ->whereEncrypted('title', 'Test title 1701335036')
    ->orWhereEncrypted('title', 'LIKE', '%' . '1701517493' . '%')
    ->orWhereEncrypted('title', 'Test title 1701517493')
    ->get();

```

Get decrypted model data
------------------------

[](#get-decrypted-model-data)

```
All decryption mde automaticaly when try ged model atributes. To get decrypted atribute values need use Resource class all take direct atributes from model.

$model = TestModel::whereEncrypted([
        ['title', '!=', 'Test title 1701517522'],
        ['title', 'Test title 1701517493']
    ])-get();

*** With laravel resource ***
TestModelResource::collection($model);

*** Get direct attributes ***
$model->title;

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~27 days

Recently: every ~40 days

Total

7

Last Release

737d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d94c492769c9efcc9ec1a35273c79805371dac4bc9ba250f4b08ca5d1bdb8b9?d=identicon)[ManageFaster](/maintainers/ManageFaster)

---

Top Contributors

[![robertaslekavicius](https://avatars.githubusercontent.com/u/61820383?v=4)](https://github.com/robertaslekavicius "robertaslekavicius (14 commits)")

### Embed Badge

![Health badge](/badges/managefaster-database/health.svg)

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

PHPackages © 2026

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