定制 famdirksen/laravel-model-encryption 二次开发

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

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

famdirksen/laravel-model-encryption

Composer 安装命令:

composer require famdirksen/laravel-model-encryption

包简介

Laravel package to encrypt model attributes

关键字:

README 文档

README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

About

This package can be used by simply adding a trait to the model you want to encrypt.

Install

Via Composer

$ composer require famdirksen/laravel-model-encryption

Usage

To use this package in your own project, you need to add the trait to the model. In the following example we installed Larave 5.6 and ran php artisan make:auth to setup authentication.

You need to use the trait, ModelEncryption and add the protected $encryptable property to your User class, this way you'll enable model encryption on your user data.

app/User.php:

<?php

namespace App;

use Famdirksen\LaravelModelEncryption\ModelEncryption;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable, ModelEncryption;

    protected $encryptable = [
        'name',
    ];

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];
}

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email info@famdirksen.nl instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 8.12k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-01