Passed
Push — master ( 3b518a...cd2a02 )
by Adam
11:23
created

Vote   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 37
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A user() 0 3 1
A guide() 0 3 1
1
<?php
2
3
namespace Coyote\Guide;
4
5
use Coyote\Guide;
6
use Coyote\Models\Scopes\ForUser;
7
use Coyote\User;
8
use Illuminate\Database\Eloquent\Model;
9
10
/**
11
 * @property int $microblog_id
12
 * @property int $user_id
13
 * @property string $ip
14
 * @property \Coyote\User $user
15
 * @property \Coyote\Microblog $microblog
16
 */
17
class Vote extends Model
18
{
19
    use ForUser;
20
21
    /**
22
     * The attributes that are mass assignable.
23
     *
24
     * @var array
25
     */
26
    protected $fillable = ['guide_id', 'user_id', 'ip'];
27
28
    /**
29
     * The database table used by the model.
30
     *
31
     * @var string
32
     */
33
    protected $table = 'guide_votes';
34
35
    /**
36
     * @var array
37
     */
38
    public $timestamps = false;
39
40
    /**
41
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
42
     */
43
    public function guide()
44
    {
45
        return $this->belongsTo(Guide::class);
46
    }
47
48
    /**
49
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
50
     */
51
    public function user()
52
    {
53
        return $this->belongsTo(User::class)->withTrashed();
54
    }
55
}
56