Looking to hire Laravel developers? Try LaraJobs

laravel_model_keys_encryption maintained by mufasil

Description
This package is to encrypt the keys like 'Id' of your database.
Author
Last update
2019/08/15 15:03 (dev-master)
License
Links
Downloads
1

Comments
comments powered by Disqus

Laravel Model Keys Encryption

Easily encrypt your table 'Id' through the trait provides in this library.

It's very important to encrypt your DB values when you are exposing it to public. This package will ease your life in 2 easily steps.

Note - this trait does not create DB columns for you. You must create your own migrations

Requirements

This package requires Laravel 5.6. Earlier versions of Laravel have a different model implementation that is not compatible with this package.

Installation

composer require mufasil/laravel_model_keys_encryption

Usage

Add the trait to your model

You'll only need to include the columns you want to encrypt.

This example will encrypt the id attribute of user table.

use Mufasil\KeyEncryption\Traits\Encryptable;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use Encryptable;
    
    protected static $encryptable = [
        'id',
    ];
}

That's it. Enjoy...