This is a great Laravel package that we can use to encrypt our model attributes before saving them to the database.

encrypt laravel

This package will store the field in their encrypted form but while retrieving it will decrypt the field. So you can use your normal operation on eloquent without worrying.

Tutorial

https://medium.com/@bvipul/encrypting-your-model-attributes-2116bf623d10

Source Code

https://github.com/bvipul/LaravelEncryptsAttributes/