PointsModel::rewarder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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