Cachet/app/models/User.php

41 lines
967 B
PHP
Raw Normal View History

2014-11-16 22:26:08 +00:00
<?php
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
2014-11-16 22:26:08 +00:00
class User extends Eloquent implements UserInterface, RemindableInterface {
2014-11-16 22:26:08 +00:00
use UserTrait, RemindableTrait;
2014-11-16 22:26:08 +00:00
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
2014-11-16 22:26:08 +00:00
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = ['password', 'remember_token'];
2014-12-01 16:46:56 +00:00
/**
* Hash any password being inserted by default
*
* @param string @password
* @return void
*/
public function setPasswordAttribute($password) {
$this->attributes['password'] = Hash::make($password);
}
2014-12-04 15:36:19 +00:00
public function getGravatarAttribute($size = 200) {
return 'https://www.gravatar.com/avatar/' . md5($this->email) . '?size=' . $size;
}
2014-12-01 16:46:56 +00:00
}