Appointment.php 871 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace App\Models;
  3. use App\Enums\AppointmentStatusEnum;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  6. use Illuminate\Database\Eloquent\SoftDeletes;
  7. class Appointment extends Model
  8. {
  9. use SoftDeletes;
  10. protected $guarded = ['id'];
  11. protected function casts(): array
  12. {
  13. return [
  14. 'date' => 'date',
  15. 'requested_at' => 'datetime',
  16. 'status' => AppointmentStatusEnum::class,
  17. ];
  18. }
  19. public function user(): BelongsTo
  20. {
  21. return $this->belongsTo(User::class);
  22. }
  23. public function partnerAgreement(): BelongsTo
  24. {
  25. return $this->belongsTo(PartnerAgreement::class);
  26. }
  27. public function partnerAgreementService(): BelongsTo
  28. {
  29. return $this->belongsTo(PartnerAgreementService::class);
  30. }
  31. }