Skip to content

Commit

Permalink
Merge pull request #3 from mrurlwin/master
Browse files Browse the repository at this point in the history
Hash passwords on User model
  • Loading branch information
ConsoleTVs authored Apr 25, 2017
2 parents 1ad4877 + 7d78b8b commit a61c997
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\User as ExtendUser;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Hash;
use Laralum\Notifications\Traits\Notifiable;
use Laralum\Roles\Traits\HasRolesAndPermissions;

Expand Down Expand Up @@ -52,4 +53,15 @@ public function hasAvatar()
// There's always a gavatar
return true;
}

/**
* Hash the password before saving.
*
* @param string $password
* @return void
*/
public function setPasswordAttribute($password)
{
$this->attributes['password'] = Hash::make($password);
}
}

0 comments on commit a61c997

Please sign in to comment.