StudentResponsible.php 4.3 KB

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