StudentResponsible.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. namespace App\Models;
  3. use App\ValueObjects\Cpf;
  4. use Illuminate\Database\Eloquent\Factories\HasFactory;
  5. use Illuminate\Database\Eloquent\Model;
  6. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  7. use Illuminate\Database\Eloquent\SoftDeletes;
  8. /**
  9. * @property int $id
  10. * @property int $student_id
  11. * @property string $name
  12. * @property \Illuminate\Support\Carbon $birth_date
  13. * @property \App\ValueObjects\Cpf $cpf
  14. * @property string|null $gender
  15. * @property string $degree
  16. * @property string $email
  17. * @property string $phone
  18. * @property string $street
  19. * @property string|null $address_number
  20. * @property string $postal_code
  21. * @property string $neighborhood
  22. * @property int $city_id
  23. * @property int $state_id
  24. * @property string|null $complement
  25. * @property string|null $notes
  26. * @property \Illuminate\Support\Carbon|null $created_at
  27. * @property \Illuminate\Support\Carbon|null $updated_at
  28. * @property \Illuminate\Support\Carbon|null $deleted_at
  29. * @property-read \App\Models\City $city
  30. * @property-read \App\Models\State $state
  31. * @property-read \App\Models\Student $student
  32. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible newModelQuery()
  33. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible newQuery()
  34. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible onlyTrashed()
  35. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible query()
  36. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereAddressNumber($value)
  37. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereBirthDate($value)
  38. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereCityId($value)
  39. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereComplement($value)
  40. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereCpf($value)
  41. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereCreatedAt($value)
  42. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereDegree($value)
  43. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereDeletedAt($value)
  44. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereEmail($value)
  45. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereGender($value)
  46. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereId($value)
  47. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereName($value)
  48. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereNeighborhood($value)
  49. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereNotes($value)
  50. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible wherePhone($value)
  51. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible wherePostalCode($value)
  52. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereStateId($value)
  53. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereStreet($value)
  54. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereStudentId($value)
  55. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible whereUpdatedAt($value)
  56. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible withTrashed(bool $withTrashed = true)
  57. * @method static \Illuminate\Database\Eloquent\Builder<static>|StudentResponsible withoutTrashed()
  58. * @mixin \Eloquent
  59. */
  60. class StudentResponsible extends Model
  61. {
  62. use HasFactory, SoftDeletes;
  63. protected $table = 'student_responsibles';
  64. protected $guarded = ['id'];
  65. protected $casts = [
  66. 'cpf' => Cpf::class,
  67. 'birth_date' => 'date',
  68. 'created_at' => 'datetime',
  69. 'updated_at' => 'datetime',
  70. 'deleted_at' => 'datetime',
  71. ];
  72. public function student(): BelongsTo
  73. {
  74. return $this->belongsTo(Student::class);
  75. }
  76. public function city(): BelongsTo
  77. {
  78. return $this->belongsTo(City::class);
  79. }
  80. public function state(): BelongsTo
  81. {
  82. return $this->belongsTo(State::class);
  83. }
  84. }