Total Complexity | 4 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 75% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class Customers extends Model |
||
9 | { |
||
10 | use SoftDeletes; |
||
11 | |||
12 | protected $primaryKey = 'cust_id'; |
||
13 | protected $fillable = ['cust_id', 'parent_id', 'name', 'dba_name', 'address', 'city', 'state', 'zip', 'active']; |
||
14 | protected $hidden = ['created_at', 'deleted_at', 'updated_at']; |
||
15 | protected $appends = ['child_count']; |
||
16 | protected $casts = [ |
||
17 | 'deleted_at' => 'datetime:M d, Y', |
||
18 | ]; |
||
19 | |||
20 | 8 | public function CustomerSystems() |
|
23 | } |
||
24 | |||
25 | 8 | public function ParentSystems() |
|
26 | { |
||
27 | 8 | return $this->hasMany('App\CustomerSystems', 'cust_id', 'parent_id'); |
|
28 | } |
||
29 | |||
30 | public function ParentCustomer() |
||
33 | } |
||
34 | |||
35 | 2 | public function getChildCountAttribute() |
|
40 |