Involved   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 36
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A user() 0 4 1
A product() 0 4 1
A lot() 0 4 1
1
<?php
2
3
namespace App;
4
5
use App\Traits\ActivateableTrait;
6
use Keyhunter\Administrator\Repository;
7
8
class Involved extends Repository
9
{
10
    use ActivateableTrait;
11
    
12
    /**
13
     * @var string
14
     */
15
    protected $table = 'involved';
16
17
    /**
18
     * @var array
19
     */
20
    protected $fillable = ['user_id', 'product_id','lot_id', 'active', 'count','price_id','color_id','size_id'];
21
22
    /**
23
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
24
     */
25
    public function user()
26
    {
27
        return $this->belongsTo(User::class);
28
    }
29
30
    /**
31
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
32
     */
33
    public function product()
34
    {
35
        return $this->hasOne(Product::class, 'id', 'product_id');
36
    }
37
38
    public function lot()
39
    {
40
        return $this->hasOne(Lot::class, 'id', 'lot_id');
41
    }
42
43
}