| Total Complexity | 5 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class Contact extends Model |
||
| 13 | { |
||
| 14 | use CrudTrait; |
||
|
|
|||
| 15 | use LogsActivity; |
||
| 16 | |||
| 17 | protected $fillable = ['firstname', 'lastname', 'idnumber', 'address', 'email', 'relationship_id', 'profession_id', 'student_id']; |
||
| 18 | |||
| 19 | protected $with = ['phone', 'relationship', 'profession']; |
||
| 20 | |||
| 21 | protected $appends = ['name']; |
||
| 22 | |||
| 23 | protected static bool $logUnguarded = true; |
||
| 24 | |||
| 25 | public function phone() |
||
| 26 | { |
||
| 27 | return $this->morphMany(PhoneNumber::class, 'phoneable'); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function getNameAttribute() |
||
| 31 | { |
||
| 32 | return $this->firstname.' '.$this->lastname; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function student() |
||
| 38 | } |
||
| 39 | |||
| 40 | public function relationship() |
||
| 43 | } |
||
| 44 | |||
| 45 | public function profession() |
||
| 50 |