arzeroid/laravel-model-encryptable
Composer 安装命令:
composer require arzeroid/laravel-model-encryptable
包简介
A simple trait to encrypt attributes before saving to the database and to decrypt attributes before using their values
README 文档
README
A simple trait to encrypt attributes before saving to the database and to decrypt attributes before using their values.
Installation
Simply add the following line to your composer.json and run composer update
"arzeroid/laravel-model-encryptable": "^1.0",
Or use composer to add it with the following command
composer require "arzeroid/laravel-model-encryptable"
Usage
Add the trait to your model and set your attributes to be encrypted in encryptable array
<?php namespace App\Models; use Arzeroid\LaravelModelEncryptable\Encryptable; class ActualPersonalCost extends BaseModel { ... use Encryptable; /** * The attributes that should be encrypted. * * @var array */ protected $encryptable = [ 'cost', ]; ... }
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-11-27