submtd/laravel-encrypted-fields

该包最新版本(1.0.0004)没有提供许可证信息。

提供了一种特质,允许在 Eloquent 模型上使用加密字段。

1.0.0004 2022-03-08 17:00 UTC

This package is auto-updated.

Last update: 2024-09-08 22:27:36 UTC


README

提供了一种特质,允许在 Eloquent 模型上使用加密字段。

安装

composer require submtd/laravel-encrypted-fields

使用方法

将 HasEncryptedFields 特质添加到您的模型类中,并添加一个名为 $encrypted 的受保护属性,其中包含应加密的字段数组。

<?php

use Illuminate\Database\Eloquent\Model;
use Submtd\LaravelCustomLog\HasEncryptedFields;

class Person extends Model
{
    use HasEncryptedFields;
    
    protected $encrypted = [
        'social_security_number',
    ];
}