5 use Illuminate\Auth\Authenticatable;
6 use Illuminate\Database\Eloquent\Model;
7 use Illuminate\Auth\Passwords\CanResetPassword;
8 use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
9 use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
11 class User extends Model implements AuthenticatableContract, CanResetPasswordContract
13 use Authenticatable, CanResetPassword;
16 * The database table used by the model.
20 protected $table = 'users';
23 * The attributes that are mass assignable.
27 protected $fillable = ['name', 'email'];
30 * The attributes excluded from the model's JSON form.
34 protected $hidden = ['password', 'remember_token'];
37 * Returns a default guest user.
39 public static function getDefault()
48 * Returns the user's avatar,
49 * Uses Gravatar as the avatar service.
53 public function getAvatar($size = 50)
55 $emailHash = md5(strtolower(trim($this->email)));
56 return '//www.gravatar.com/avatar/' . $emailHash . '?s=' . $size . '&d=identicon';