Involved::product()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
}