User.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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<int, string>
  14. */
  15. protected $fillable = [
  16. 'name',
  17. 'email',
  18. 'photo',
  19. 'password',
  20. 'phone',
  21. 'country',
  22. 'address',
  23. 'state',
  24. 'city',
  25. 'zip',
  26. 'token',
  27. 'status',
  28. ];
  29. /**
  30. * The attributes that should be hidden for serialization.
  31. *
  32. * @var array<int, string>
  33. */
  34. protected $hidden = [
  35. 'password',
  36. 'remember_token',
  37. ];
  38. /**
  39. * Get the attributes that should be cast.
  40. *
  41. * @return array<string, string>
  42. */
  43. protected function casts(): array
  44. {
  45. return [
  46. 'email_verified_at' => 'datetime',
  47. 'password' => 'hashed',
  48. ];
  49. }
  50. public function bookings()
  51. {
  52. return $this->hasMany(Booking::class);
  53. }
  54. public function reviews()
  55. {
  56. return $this->hasMany(Review::class);
  57. }
  58. public function wishlists()
  59. {
  60. return $this->hasMany(Wishlist::class);
  61. }
  62. public function messages()
  63. {
  64. return $this->hasMany(Message::class);
  65. }
  66. }