PointsModel   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 33
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A earner() 0 4 1
A rewarder() 0 4 1
A item() 0 4 1
1
<?php
2
3
namespace Pbmedia\Gamification\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class PointsModel extends Model
8
{
9
    protected $table = 'gamification_points';
10
11
    protected $fillable = [
12
        'earner_id',
13
        'earner_type',
14
        'rewarder_id',
15
        'rewarder_type',
16
        'item_id',
17
        'item_type',
18
        'points',
19
    ];
20
21
    protected $casts = [
22
        'points' => 'int',
23
    ];
24
25
    public function earner()
26
    {
27
        return $this->morphTo();
28
    }
29
30
    public function rewarder()
31
    {
32
        return $this->morphTo();
33
    }
34
35
    public function item()
36
    {
37
        return $this->morphTo();
38
    }
39
}
40