Message   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A thread() 0 4 1
A user() 0 4 1
1
<?php
2
3
namespace Aurawindsurfing\Messenger;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class Message.
9
 */
10
class Message extends Model
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $table = 'messenger_messages';
16
17
    /**
18
     * @var array
19
     */
20
    protected $fillable = ['thread_id', 'user_id', 'body', 'read_at'];
21
22
    /**
23
     * @var array
24
     */
25
    protected $touches = ['thread'];
26
27
    /**
28
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
29
     */
30
    public function thread()
31
    {
32
        return $this->belongsTo(Thread::class);
33
    }
34
35
    public function user()
36
    {
37
        return $this->belongsTo(\App\User::class);
38
    }
39
}
40