Looking to hire Laravel developers? Try LaraJobs

laravel-encrypt maintained by bilan

Last update
2023/10/26 14:15 (v1.0.2)
Links
Downloads
5

Comments
comments powered by Disqus

LARAVEL-ENCRYPT

  • Use trait for your models when you want to hash attribute, in the database type of field for the attribute should be TEXT:

  • Example for Model:

use ModelUseEncryptedAttributes;


/**
 * @return Attribute
 */
public function host(): Attribute
{
    return $this->encryptedAttribute();
}
  • Attribute will automatically been hashed for save/update and uhashed when you will initialize the model