Completed
Push — master ( b7f417...e961f1 )
by Sherif
02:36
created

Notification::getReadAtAttribute()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 1
1
<?php namespace App\Modules\V1\Notifications;
2
3
use Illuminate\Notifications\DatabaseNotification;
4
use Illuminate\Database\Eloquent\SoftDeletes;
5
6
class Notification extends DatabaseNotification{
7
8
    public function getCreatedAtAttribute($value)
9
    {
10
        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
11
    }
12
13
    public function getUpdatedAtAttribute($value)
14
    {
15
        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
16
    }
17
18
    public function getDeletedAtAttribute($value)
19
    {
20
        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
21
    }
22
23
    public function getReadAtAttribute($value)
24
    {
25
        return ! $value ? false : \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
26
    }
27
}
28