| Total Complexity | 5 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 80% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class MessagingInfo extends Model |
||
| 14 | { |
||
| 15 | protected $guarded = []; |
||
| 16 | protected $appends = [ |
||
| 17 | 'startTime', |
||
| 18 | ]; |
||
| 19 | |||
| 20 | 1 | public function getStartTimeAttribute() |
|
| 21 | { |
||
| 22 | 1 | return new Carbon($this->attributes['startTime']); |
|
| 23 | } |
||
| 24 | |||
| 25 | public function getEndTimeAttribute() |
||
| 26 | { |
||
| 27 | return new Carbon($this->attributes['endTime']); |
||
| 28 | } |
||
| 29 | |||
| 30 | 1 | public function getMinutesAttribute() |
|
| 31 | { |
||
| 32 | 1 | return round(($this->attributes['duration'] / 1000) / 60, 2); |
|
| 33 | } |
||
| 34 | |||
| 35 | 1 | public function getSecondsAttribute() |
|
| 36 | { |
||
| 37 | 1 | return $this->attributes['duration'] / 1000; |
|
| 38 | } |
||
| 39 | |||
| 40 | 1 | public function getHoursAttribute() |
|
| 43 | } |
||
| 44 | } |
||
| 45 |