Comment   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 43
ccs 0
cts 4
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A user() 0 4 1
A video() 0 4 1
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class Comment.
9
 */
10
class Comment extends Model
11
{
12
    /**
13
     * Table name.
14
     *
15
     * @var string
16
     */
17
    protected $table = 'comments';
18
19
    /**
20
     * The attributes that are mass assignable.
21
     *
22
     * @var array
23
     */
24
    protected $fillable = ['user_id', 'video_id', 'comment'];
25
26
    /**
27
     * The attributes that should be hidden for arrays.
28
     *
29
     * @var array
30
     */
31
    protected $hidden = [];
32
33
    /**
34
     * User relation.
35
     *
36
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
37
     */
38
    public function user()
39
    {
40
        return $this->belongsTo(\App\User::class);
41
    }
42
43
    /**
44
     * Video relation.
45
     *
46
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
47
     */
48
    public function video()
49
    {
50
        return $this->belongsTo(\App\Video::class);
51
    }
52
}
53