larapack/attribute-hashing

Allows you to define what attributes in your Eloquent Model which should be hashed.
1,234 2
Install
composer require larapack/attribute-hashing
Latest Version:v1.0.0
License:MIT
Last Updated:Mar 4, 2016
Links: GitHub  ·  Packagist
Maintainer: marktopper

attribute-hashing

Allows you to define what attributes in your Eloquent Model which should be hashed.

Installing

Install using Composer composer require larapack/attribute-hashing 1.*.

Usage

First add the traits Manipulateable and Hashable to your Eloquent Model.

<?php

namespace App;

use Larapack/AttributeManipulating/Manipulateable;
use Larapack/AttributeHashing/Hashable;

class User
{
  use Manipulateable;
  use Hashable;
  
  /**
   * @var array List of attribute names which should be hashed
   */ 
  protected $hash = ['password']; // set the attribute names you which to hash
  
  //...
}

Now whenever you set the attribute password it will now be hashed.

Test:

$user = new App\User;
$user->password = 'secret';
echo $user->password // Here you will see the encrypted password

Related Packages

larapack/attribute-encryption

Allows you to define what attributes in your eloquent model which should be encr...

1,936 3
larapack/attribute-slugging

Allows your Eloquent Model to automatically generate a unique slug for a attribu...

2,023 5
hisorange/laravel-hash

Replace the BCrypt hashing with native PHP hashing algorithm for Laravel.

8 1
larapack/attribute-manipulation

Allows multiple traits to manipulate with the attributes of an Eloquent Model.

3,185 4
larapack/command-validation

Enable a method for Artisan Commands to validate the output of methods like `ask...

4,261 12