Test Failed
Push — master ( a84a97...6a5aa6 )
by Gianluca
07:16
created

Product   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A items() 0 2 1
A category() 0 2 1
A details() 0 2 1
1
<?php
2
3
4
namespace Mongi\Mongicommerce\Models;
5
6
7
use Illuminate\Database\Eloquent\Factories\HasFactory;
8
use Illuminate\Database\Eloquent\Model;
9
10
class Product extends Model
11
{
12
    use HasFactory;
13
14
    protected $dates = ["created_at","updated_at"];
15
16
    public function items(){
17
        return $this->hasMany(ProductItem::class);
18
    }
19
20
    public function category(){
21
        return $this->belongsTo(Category::class);
22
    }
23
24
    public function details(){
25
        return $this->hasManyThrough(ProductItemDetail::class,ProductItem::class);
26
    }
27
28
29
}
30