Passed
Pull Request — master (#25)
by
unknown
04:11
created

SmsEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 34
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createdBy() 0 3 1
A updatedBy() 0 3 1
1
<?php
2
3
namespace App;
4
5
use Sofa\Eloquence\Eloquence;
6
use Illuminate\Database\Eloquent\Model;
7
8
class SmsEvent extends Model
9
{
10
    protected $table = 'mst_sms_events';
11
12
    protected $fillable = [
13
            'name',
14
            'date',
15
            'message',
16
            'description',
17
            'status',
18
            'send_to',
19
            'created_by',
20
            'updated_by',
21
    ];
22
23
    protected $dates = ['created_at', 'updated_at', 'date'];
24
25
    //Eloquence Search mapping
26
    use Eloquence;
27
28
    protected $searchableColumns = [
29
        'name' => 20,
30
        'date' => 10,
31
        'message' => 5,
32
    ];
33
34
    public function createdBy()
35
    {
36
        return $this->belongsTo('App\User', 'created_by');
37
    }
38
39
    public function updatedBy()
40
    {
41
        return $this->belongsTo('App\User', 'updated_by');
42
    }
43
}
44