Files
cachet-docker/app/models/User.php
Graham Campbell 9d8d89248f CS fixes
2014-12-20 21:20:17 +00:00

55 lines
1.2 KiB
PHP

<?php
use Illuminate\Auth\Reminders\RemindableInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\UserTrait;
class User extends Eloquent implements UserInterface, RemindableInterface
{
use UserTrait, RemindableTrait;
/**
* The database table used by the model.
* @var string
*/
protected $table = 'users';
/**
* The attributes excluded from the model's JSON form.
* @var array
*/
protected $hidden = ['password', 'remember_token'];
/**
* Items which cannot be mass assigned.
* @var array
*/
protected $guarded = [];
/**
* Hash any password being inserted by default
*
* @param string @password
* @return void
*/
public function setPasswordAttribute($password)
{
$this->attributes['password'] = Hash::make($password);
}
/**
* Returns a Gravatar URL for the users email address.
* @param integer $size
* @return string
*/
public function getGravatarAttribute($size = 200)
{
return sprintf(
'https://www.gravatar.com/avatar/%s?size=%d',
md5($this->email),
$size
);
}
}