Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SMEWebify committed May 10, 2024
1 parent e81e1bc commit b2e7c6f
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,26 +236,12 @@ public function getActivitylogOptions(): LogOptions
}

// Encrypt while setting
public function setEmailAttribute($value)
{
$this->attributes['email'] = Crypt::encrypt($value);
}

// Decrypt while getting
public function getEmailAttribute($value)
{
try {
return decrypt($value);
} catch (\Illuminate\Contracts\Encryption\DecryptException $e) {
return null;
}
}

public function setPersonnalPhoneNumberAttribute($value)
public function setPersonnalPhoneNumberAttribute($value)
{
$this->attributes['personnal_phone_number'] = Crypt::encrypt($value);
}

// Decrypt while getting
public function getPersonnalPhoneNumberAttribute($value)
{
try {
Expand Down

0 comments on commit b2e7c6f

Please sign in to comment.