Completed
Push — discuss ( 472fcb...21bc4b )
by Fèvre
16:38
created

DiscussLog   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A user() 0 4 1
A loggable() 0 4 1
1
<?php
2
namespace Xetaravel\Models;
3
4
use Xetaravel\Models\Presenters\DiscussLogPresenter;
5
6
class DiscussLog extends Model
7
{
8
    use DiscussLogPresenter;
9
10
    /**
11
     * The attributes that should be cast to native types.
12
     *
13
     * @var array
14
     */
15
    protected $casts = [
16
        'data' => 'array'
17
    ];
18
19
    /**
20
     * Get the user that owns the log.
21
     *
22
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
23
     */
24
    public function user()
25
    {
26
        return $this->belongsTo(User::class);
27
    }
28
29
    /**
30
     * Get the loggable relation.
31
     *
32
     * @return \Illuminate\Database\Eloquent\Relations\MorphTo
33
     */
34
    public function loggable()
35
    {
36
        return $this->morphTo();
37
    }
38
}
39