Notification   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 29
rs 10
c 1
b 0
f 1
wmc 4
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A fromUser() 0 4 1
A reply() 0 4 1
A topic() 0 4 1
A getPresenterClass() 0 4 1
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