Преглед изворни кода

client() relationship method for generic invokation

Vijayakrishnan пре 3 година
родитељ
комит
e3733ee60b
4 измењених фајлова са 16 додато и 0 уклоњено
  1. 4 0
      app/Models/CareMonth.php
  2. 4 0
      app/Models/ClientProChange.php
  3. 4 0
      app/Models/IncomingReport.php
  4. 4 0
      app/Models/Ticket.php

+ 4 - 0
app/Models/CareMonth.php

@@ -14,6 +14,10 @@ class CareMonth extends Model
         return $this->hasOne(Client::class, 'id', 'client_id');
     }
 
+    public function client(){
+        return $this->hasOne(Client::class, 'id', 'client_id');
+    }
+
     public function mcp(){
         return $this->hasOne(Pro::class, 'id', 'mcp_pro_id');
     }

+ 4 - 0
app/Models/ClientProChange.php

@@ -12,4 +12,8 @@ class ClientProChange extends Model
     public function patient(){
         return $this->hasOne(Client::class, 'id', 'client_id');
     }
+
+    public function client(){
+        return $this->hasOne(Client::class, 'id', 'client_id');
+    }
 }

+ 4 - 0
app/Models/IncomingReport.php

@@ -15,4 +15,8 @@ class IncomingReport extends Model
     public function patient(){
         return $this->hasOne(Client::class, 'id', 'client_id');
     }
+
+    public function client(){
+        return $this->hasOne(Client::class, 'id', 'client_id');
+    }
 }

+ 4 - 0
app/Models/Ticket.php

@@ -28,6 +28,10 @@ class Ticket extends Model
         return $this->hasOne(Client::class, 'id', 'client_id');
     }
 
+    public function client(){
+        return $this->hasOne(Client::class, 'id', 'client_id');
+    }
+
     public function faxes(){
         return $this->hasMany(TicketFax::class, 'ticket_id', 'id')
             ->orderBy('sent_at', 'desc');