Passed
Push — master ( 02f750...fc8b14 )
by Ron
01:32
created

MapCategory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCreatedAtAttribute() 0 3 1
A getUpdatedAtAttribute() 0 3 1
1
<?php
2
3
namespace Starpeace\Models\Eloquent\Common;
4
5
use Starpeace\Models\Eloquent\BaseModel;
6
7
class MapCategory extends BaseModel
8
{
9
    protected $table = 'map_categories';
10
11
    protected $fillable = ['name', 'display_name'];
12
13
    protected $dates = ['created_at', 'updated_at'];
14
15
    protected $dateFormat ='Y-m-d H:i:s';
16
17
    public function getCreatedAtAttribute($value)
18
    {
19
        return $value->format('d.m.Y H:i:s');
20
    }
21
22
    public function getUpdatedAtAttribute($value)
23
    {
24
        return $value->format('d.m.Y H:i:s');
25
    }
26
}