Reputation: 1655
At the moment, I have a field within my Laravel project that requires some form of encryption, so I use the available encryption through Laravel, and decrypt using the following in my blade:
{{\Crypt::decryptString($e->SCEIN)}}
But I was curious if there was a way for me to be able to show only the last 8 characters of this field after it has been decrypted. I can't seem to find much mention of it though I do know using substr
would technically get me there, I am not sure how to use it on an encrypted field.
Upvotes: 1
Views: 231
Reputation: 521
You can wrap the whole decrypt string inside the substr
function and setting -8
in the second param will give you the last 8 characters.
{{ substr( \Crypt::decryptString($e->SCEIN), -8 ) }}
Upvotes: 5