赵明斯基 / laravel-encrypt
此包的最新版本(1.0.0)没有可用的许可证信息。
1.0.0
2023-09-01 09:02 UTC
Requires
- php: ^8.0
- ext-openssl: *
README
-
当您想在模型中哈希属性时,请使用特性,该属性的数据库字段类型应该是
TEXT
-
模型示例
use Illuminate\Database\Eloquent\Casts\Attribute;
...implements ...IModelUseEncryptedAttributes{
use ModelUseEncryptedAttributes;
...
public function attributeOne() :Attribute
{
return $this->encryptedAttribute();
}
...
public function attributeTwo() :Attribute
{
return $this->encryptedAttribute();
}
...
- 属性将在保存/更新时自动哈希,并在初始化模型时解哈希