Passed
Push — master ( 5b3b8d...651c0f )
by Dan Michael O.
04:34
created

LogEntry   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 45
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getLinesAttribute() 0 3 1
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class LogEntry extends Model
8
{
9
    /**
10
     * The table associated with the model.
11
     *
12
     * @var string
13
     */
14
    protected $table = 'log';
15
16
    /**
17
     * Indicates if the model should be timestamped.
18
     *
19
     * @var bool
20
     */
21
    public $timestamps = false;
22
23
    /**
24
     * The attributes that should be cast to native types.
25
     *
26
     * @var array
27
     */
28
    protected $casts = [
29
        'time' => 'datetime',
30
        'context' => 'array',
31
    ];
32
33
    /**
34
     * The attributes that are mass assignable.
35
     *
36
     * @var array
37
     */
38
    protected $fillable = [
39
        'channel',
40
        'message',
41
        'level',
42
        'level_name',
43
        'context',
44
        'file',
45
        'line',
46
        'time',
47
    ];
48
49
    public function getLinesAttribute()
50
    {
51
        return explode(PHP_EOL, $this->message);
52
    }
53
}
54