/ app / Models / LaboratoryLog.php
LaboratoryLog.php
 1  <?php
 2  
 3  namespace App\Models;
 4  
 5  use Illuminate\Database\Eloquent\Factories\HasFactory;
 6  use Illuminate\Database\Eloquent\Model;
 7  
 8  class LaboratoryLog extends Model
 9  {
10      use HasFactory;
11  
12      protected $fillable = ['user_id', 'laboratory_id', 'laboratory_representative_id', 'log_change', 'log_type_id'];
13  
14      public function user()
15      {
16          return $this->belongsTo(User::class);
17      }
18  
19      public function logChanges()
20      {
21          return $this->hasMany(LogChange::class);
22      }
23  
24      public function logType()
25      {
26          return $this->belongsTo(LogType::class);
27      }
28  
29      public function laboratory()
30      {
31          return $this->belongsTo(Laboratory::class);
32      }
33  
34      public function laboratoryRepresentative()
35      {
36          return $this->belongsTo(LaboratoryRepresentative::class);
37      }
38  
39      public function pointOfContact()
40      {
41          return $this->belongsTo(PointOfContact::class);
42      }
43  }