CustomerEquipmentData   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 2
b 0
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFieldNameAttribute() 0 3 1
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\Factories\HasFactory;
7
8
class CustomerEquipmentData extends Model
9
{
10
    use HasFactory;
11
12
    protected $guarded = ['id', 'created_at', 'updated_at'];
13
    protected $hidden  = ['cust_equip_id', 'field_id', 'created_at', 'updated_at'];
14
    protected $appends = ['field_name'];
15
16
    /*
17
    *   The name of the field this value data belongs to
18
    */
19
    public function getFieldNameAttribute()
20
    {
21
        return DataField::with('DataFieldType')->find($this->field_id)->DataFieldType->name;
22
    }
23
}
24