jamesautodude's avatar

jamesautodude wrote a reply+100 XP

4mos ago

To anyone coming across this later like I did...

In newest versions, you can just use casts in the model, and put it as "encrypted" like:

protected $casts = [
    'email' => 'encrypted',
    'phone' => 'encrypted',
    'salary' => 'encrypted'
];

And Laravel will handle the encrypting and decrypting all on its own while you just make calls/updates/inserts as normal