My beer compendium
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
960 B

3 years ago
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Contracts\Auth\MustVerifyEmail;
  4. use Illuminate\Database\Eloquent\Factories\HasFactory;
  5. use Illuminate\Foundation\Auth\User as Authenticatable;
  6. use Illuminate\Notifications\Notifiable;
  7. class User extends Authenticatable
  8. {
  9. use HasFactory, Notifiable;
  10. /**
  11. * The attributes that are mass assignable.
  12. *
  13. * @var array
  14. */
  15. protected $fillable = [
  16. 'name',
  17. 'email',
  18. 'username',
  19. 'password',
  20. ];
  21. /**
  22. * The attributes that should be hidden for arrays.
  23. *
  24. * @var array
  25. */
  26. protected $hidden = [
  27. 'password',
  28. 'remember_token',
  29. ];
  30. /**
  31. * The attributes that should be cast to native types.
  32. *
  33. * @var array
  34. */
  35. protected $casts = [
  36. 'email_verified_at' => 'datetime',
  37. ];
  38. public function isAdmin() {
  39. if($this->is_admin){
  40. return true;
  41. }
  42. return false;
  43. }
  44. }