User.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. use Illuminate\Auth\UserInterface;
  3. use Illuminate\Auth\Reminders\RemindableInterface;
  4. class User extends Eloquent implements UserInterface, RemindableInterface {
  5. /**
  6. * The database table used by the model.
  7. *
  8. * @var string
  9. */
  10. protected $table = 'users';
  11. /**
  12. * The attributes excluded from the model's JSON form.
  13. *
  14. * @var array
  15. */
  16. protected $hidden = array('password');
  17. /**
  18. * Get the unique identifier for the user.
  19. *
  20. * @return mixed
  21. */
  22. public function getAuthIdentifier()
  23. {
  24. return $this->getKey();
  25. }
  26. /**
  27. * Get the password for the user.
  28. *
  29. * @return string
  30. */
  31. public function getAuthPassword()
  32. {
  33. return $this->password;
  34. }
  35. /**
  36. * Get the token value for the "remember me" session.
  37. *
  38. * @return string
  39. */
  40. public function getRememberToken()
  41. {
  42. return $this->remember_token;
  43. }
  44. /**
  45. * Set the token value for the "remember me" session.
  46. *
  47. * @param string $value
  48. * @return void
  49. */
  50. public function setRememberToken($value)
  51. {
  52. $this->remember_token = $value;
  53. }
  54. /**
  55. * Get the column name for the "remember me" token.
  56. *
  57. * @return string
  58. */
  59. public function getRememberTokenName()
  60. {
  61. return 'remember_token';
  62. }
  63. /**
  64. * Get the e-mail address where password reminders are sent.
  65. *
  66. * @return string
  67. */
  68. public function getReminderEmail()
  69. {
  70. return $this->email;
  71. }
  72. }