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

Post::comments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
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