Member.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. class Member extends Model
  6. {
  7. use HasFactory;
  8. protected $fillable = [
  9. 'first_name',
  10. 'last_name',
  11. 'status',
  12. 'birth_city_id',
  13. 'birth_province_id',
  14. 'birth_nation_id',
  15. 'birth_date',
  16. 'gender',
  17. 'address',
  18. 'zip_code',
  19. 'fiscal_code',
  20. 'nation_id',
  21. 'province_id',
  22. 'city_id',
  23. 'phone',
  24. 'email',
  25. 'enabled',
  26. ];
  27. public function nation()
  28. {
  29. return $this->belongsTo(Nation::class);
  30. }
  31. public function province()
  32. {
  33. return $this->belongsTo(Province::class);
  34. }
  35. public function city()
  36. {
  37. return $this->belongsTo(City::class);
  38. }
  39. public function birth_nation()
  40. {
  41. return $this->belongsTo(Nation::class);
  42. }
  43. public function birth_province()
  44. {
  45. return $this->belongsTo(Province::class);
  46. }
  47. public function birth_city()
  48. {
  49. return $this->belongsTo(City::class);
  50. }
  51. }