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

DiscussLog::user()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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