CustomerContact::CustomerContactPhone()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
use Illuminate\Database\Eloquent\Factories\HasFactory;
8
9
class CustomerContact extends Model
10
{
11
    use HasFactory;
12
    use SoftDeletes;
13
14
    protected $primaryKey = 'cont_id';
15
    protected $guarded    = ['cont_id', 'created_at', 'updated_at'];
16
    protected $hidden     = ['created_at', 'updated_at', 'deleted_at'];
17
    protected $casts      = [
18
        'deleted_at' => 'datetime:M d, Y',
19
    ];
20
21
    /*
22
    *   Each customer contact can have several phone numbers attached
23
    */
24
    public function CustomerContactPhone()
25
    {
26
        return $this->hasMany(CustomerContactPhone::class, 'cont_id', 'cont_id');
27
    }
28
}
29