Meta   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 42
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A metaablePrice() 0 4 1
A scopeGroup() 0 4 1
1
<?php
2
3
namespace App\Libraries\MetaablePrice;
4
5
use Keyhunter\Administrator\Repository as KeyhunterRepository;
6
7
class Meta extends KeyhunterRepository
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $table = 'product_specifications_price';
13
14
    /**
15
     * @var array
16
     */
17
    protected $guarded = ['id'];
18
19
    /**
20
     * @var array
21
     */
22
    protected $fillable = [ 'product_id','price_new','price_old','sale','size', 'color_hash', 'amount','key','value'];
23
24
    /**
25
     * @var bool
26
     */
27
    public $timestamps = false;
28
29
    /**
30
     * @return \Illuminate\Database\Eloquent\Relations\MorphTo
31
     */
32
    public function metaablePrice()
33
    {
34
        return $this->morphTo();
35
    }
36
37
    /**
38
     * Scope meta group.
39
     *
40
     * @param $query
41
     * @param $group
42
     * @return mixed
43
     */
44
    public function scopeGroup($query, $group)
45
    {
46
        return $query->whereGroup($group);
47
    }
48
}