Vote::votes()   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 1
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace PHPHub;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Vote extends Model
8
{
9
    protected $guarded = [];
10
11
    public function votable()
12
    {
13
        return $this->morphTo();
14
    }
15
16
    public function votes()
17
    {
18
        return $this->morphMany(self::class, 'votable');
19
    }
20
}
21