Completed
Push — master ( c7d5ad...0208a8 )
by Sherif
02:59
created

Report   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 29
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getCreatedAtAttribute() 0 4 1
A getUpdatedAtAttribute() 0 4 1
A getDeletedAtAttribute() 0 4 1
A boot() 0 4 1
1
<?php namespace App\Modules\Reporting;
2
3
use Illuminate\Database\Eloquent\Model;
4
use Illuminate\Database\Eloquent\SoftDeletes;
5
6
class Report extends Model{
7
8
    use SoftDeletes;
9
	protected $table    = 'reports';
10
	protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
11
	protected $hidden   = ['deleted_at'];
12
	protected $guarded  = ['id'];
13
	protected $fillable = ['report_name', 'view_name'];
14
15
	public function getCreatedAtAttribute($value)
16
    {
17
        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
18
    }
19
20
    public function getUpdatedAtAttribute($value)
21
    {
22
        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
23
    }
24
25
    public function getDeletedAtAttribute($value)
26
    {
27
        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
28
    }
29
    
30
    public static function boot()
31
    {
32
        parent::boot();
33
    }
34
}
35