code-orange/encryptable

为 Laravel 模型提供的 Encryptable 特性

v1.2 2020-10-30 12:36 UTC

This package is auto-updated.

Last update: 2024-08-29 05:43:23 UTC


README

此包为 Laravel 模型添加 encryptable 特性,当与数据库通信时自动加密和解密。

安装

首先,请确保您已正确设置了 Code Orange 包注册表

composer require code-orange/encryptable

用法

在您的 Laravel 模型中添加一个受保护的 $encrypted 特性。例如:

protected $encryptable = [
		'first_name', 'last_name', 'country', 'zipcode', 'housenumber', 'street', 'city', 'phone', 'email',
	];