In one application where i am using backpack for admin dashboard. I am sending data(such as 'name', 'email') as encrypting AES256 to stored in the database. Now, I want to retrieve those data and show in the admin dashboard. But the problem is how will I decrypt those data values before showing in the dashboard ?
Asked
Active
Viewed 71 times
0
-
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Aug 30 '21 at 00:56
1 Answers
0
If you wanna decrypt your data from the database, you can use accessors
in your models to modify the shown data.
So, in your users
model add this function:
public function getNameAttribute($value) {
// Add decrypt methond in this function
// $name = decrypt($value, 'password');
return $name;
}
public function getEmailAttribute($value) {
// Add decrypt methond in this function
// $email = decrypt($value, 'password');
return $email;
}
I found the decrypt example here https://stackoverflow.com/a/46872528/8653054

vreedom18
- 341
- 2
- 13