Notification::reply()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PHPHub;
4
5
use Illuminate\Database\Eloquent\Model;
6
use McCool\LaravelAutoPresenter\HasPresenter;
7
use PHPHub\Presenters\NotificationPresenter;
8
9
class Notification extends Model implements HasPresenter
10
{
11
    protected $guarded = [];
12
13
    public function fromUser()
14
    {
15
        return $this->belongsTo(User::class, 'from_user_id');
16
    }
17
18
    public function reply()
19
    {
20
        return $this->belongsTo(Reply::class);
21
    }
22
23
    public function topic()
24
    {
25
        return $this->belongsTo(Topic::class);
26
    }
27
28
    /**
29
     * Get the presenter class.
30
     *
31
     * @return string
32
     */
33
    public function getPresenterClass()
34
    {
35
        return NotificationPresenter::class;
36
    }
37
}
38