Passed
Branch master (3ea22d)
by Fariz
03:08
created

Post   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A author() 0 3 1
A comments() 0 3 1
1
<?php
2
/**
3
 * StupidlySimple - A PHP Framework For Lazy Developers.
4
 *
5
 * @author		Fariz Luqman <[email protected]>
6
 * @copyright	2017 Fariz Luqman
7
 * @license		MIT
8
 *
9
 * @link		https://stupidlysimple.github.io/
10
 */
11
12
namespace Model;
13
14
use Illuminate\Database\Eloquent\Model as Eloquent;
15
16
class Post extends Eloquent
17
{
18
    /**
19
     * Get the comments for the Post.
20
     */
21
    public function comments()
22
    {
23
        return $this->hasMany('Model\Comment');
24
    }
25
26
    public function author()
27
    {
28
        return $this->belongsTo('Model\User', 'author_id');
29
    }
30
}
31