Appointment.php 540 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Relations\HasOne;
  4. # use Illuminate\Database\Eloquent\Model;
  5. class Appointment extends Model
  6. {
  7. protected $table = 'appointment';
  8. public function client() {
  9. return $this->hasOne(Client::class, 'id', 'client_id');
  10. }
  11. public function pro() {
  12. return $this->hasOne(Pro::class, 'id', 'pro_id');
  13. }
  14. public function confirmationRequests() {
  15. return $this->hasMany(AppointmentConfirmationRequest::class, 'appointment_id', 'id');
  16. }
  17. }