add: donation transaction encryption

This commit is contained in:
HDVinnie
2024-09-17 11:20:30 -04:00
parent 676148d44b
commit 13208052f5
2 changed files with 13 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ declare(strict_types=1);
namespace App\Models;
use App\Traits\Encryptable;
use Illuminate\Database\Eloquent\Model;
/**
@@ -35,6 +36,8 @@ use Illuminate\Database\Eloquent\Model;
*/
class Donation extends Model
{
use Encryptable;
final public const int PENDING = 0;
final public const int APPROVED = 1;
final public const int REJECTED = 2;
@@ -67,6 +70,15 @@ class Donation extends Model
*/
protected $guarded = ['id'];
/**
* The Attributes That Are Encrypted.
*
* @var string[]
*/
protected array $encryptable = [
'transaction',
];
/**
* Belongs To A User.
*

View File

@@ -30,7 +30,7 @@ return new class () extends Migration {
$table->unsignedInteger('gifted_user_id')->nullable()->index();
$table->tinyInteger('status')->default(0);
$table->unsignedInteger('package_id')->index();
$table->string('transaction');
$table->text('transaction');
$table->boolean('is_gifted')->default(false);
$table->date('starts_at')->nullable();
$table->date('ends_at')->nullable();