定制 dtisgodsson/elocrypt 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dtisgodsson/elocrypt

最新稳定版本:v1.6

Composer 安装命令:

composer require dtisgodsson/elocrypt

包简介

Automatically encrypt and decrypt Eloquent attributes with ease.

README 文档

README

Installation

This package can be installed via Composer by adding the following to your composer.json file:

"require": {
	"dtisgodsson/elocrypt": "1.*"
}

You must then run the following command:

composer update

Usage

Simply reference the ElocryptTrait in any Eloquent Model you wish to apply encryption to and then define an "encryptable" array on that model containing a list of the attributes you wish to Encrypt.

For example:

class User extends Eloquent {

		use ElocryptTrait;

		public $encryptable = ['first_name', 'last_name', 'address_line_1', 'postcode'];
}

How it Works?

By including the ElocryptTrait, the __set() and __get() methods provided by Eloquent are overridden to include an additional step. This additional step simply checks whether the attribute being set or get is included in the "encryptable" array on the model, and either encrypts/decrypts it accordingly OR calls the parent __set() or __get() method.

统计信息

  • 总下载量: 830
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-09-05