PHP code example of w360 / secure-data

1. Go to this page and download the library: Download w360/secure-data library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

w360 / secure-data example snippets




namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;
use W360\SecureData\Traits\HasEncryptedFields;


class User extends Authenticatable
{
    use HasEncryptedFields;


    /**
     * The attributes that are mass assignable.
     *
     *@var array
     */
    protected $fillable = [
        'first_name',
        'last_name',
        'email',
        'identifier',
        'salary',
        'status',
        'password'
    ];
    
    /**
     * The attributes that should be encrypted.
     *
     * @var array<string, string>
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
        'email' => Secure::class,
        'identifier' => Secure::class,
        'first_name' => Secure::class,
        'last_name' => Secure::class,
        'salary' => Secure::class,
        'status' => Secure::class,
    ];
    
}