submtd/laravel-encrypted-fields

There is no license information available for the latest version (1.0.0004) of this package.

Provides a trait that allows for encrypted fields on an Eloquent model

1.0.0004 2022-03-08 17:00 UTC

This package is auto-updated.

Last update: 2024-04-08 21:41:53 UTC


README

Provides a trait that allows for encrypted fields on an Eloquent model

Installation

composer require submtd/laravel-encrypted-fields

Usage

Add the HasEncryptedFields trait to your model class, and add a protected property called $encrypted containing an array of fields that should be encrypted.

<?php

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

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