A laravel's eloquent cast to encrypt/decrypt data.
To install use:
composer require amirhossein5/encrypted
Use \AmirHossein5\Encrypted\Encrypted
cast inside your model:
<?php
use AmirHossein5\Encrypted\Encrypted;
class User extends Authenticatable
{
// ...
protected $casts = [
'name' => Encrypted::class,
'email' => Encrypted::class,
];
}
It'll encrypt and decrypt based on APP_KEY using laravel's Crypt facade
This package is licenced under MIT LICENCE.