LikeCounter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 25
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A likeable() 0 3 1
1
<?php
2
3
namespace Turahe\Likeable\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Turahe\Likeable\Contracts\LikeCounter as LikeCounterContract;
7
8
/**
9
 * Class LikeCounter.
10
 */
11
class LikeCounter extends Model implements LikeCounterContract
12
{
13
    protected $table = 'like_counters';
14
    protected $fillable = [
15
        'type_id',
16
        'count',
17
    ];
18
19
    /**
20
     * The attributes that should be cast to native types.
21
     *
22
     * @var array
23
     */
24
    protected $casts = [
25
        'count' => 'integer',
26
    ];
27
28
    /**
29
     * Likeable model relation.
30
     *
31
     * @return \Illuminate\Database\Eloquent\Relations\MorphTo
32
     */
33
    public function likeable()
34
    {
35
        return $this->morphTo();
36
    }
37
}
38