| Package Data | |
|---|---|
| Maintainer Username: | marktopper |
| Package Create Date: | 2015-11-27 |
| Package Last Update: | 2016-03-04 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-22 15:11:53 |
| Package Statistics | |
|---|---|
| Total Downloads: | 1,219 |
| Monthly Downloads: | 16 |
| Daily Downloads: | 4 |
| Total Stars: | 2 |
| Total Watchers: | 1 |
| Total Forks: | 0 |
| Total Open Issues: | 0 |
Allows you to define what attributes in your Eloquent Model which should be hashed.
Install using Composer composer require larapack/attribute-hashing 1.*.
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