@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @var array |
27 | 27 | */ |
28 | - protected $hidden = ['token']; |
|
28 | + protected $hidden = [ 'token' ]; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * The attributes that are mass assignable. |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | else |
120 | 120 | $time = new Carbon($value, 'UTC'); |
121 | 121 | |
122 | - $this->attributes['open_time'] = $time; |
|
122 | + $this->attributes[ 'open_time' ] = $time; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | else |
142 | 142 | $time = new Carbon($value, 'UTC'); |
143 | 143 | |
144 | - $this->attributes['close_time'] = $time; |
|
144 | + $this->attributes[ 'close_time' ] = $time; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -75,8 +75,9 @@ discard block |
||
75 | 75 | $time = new Carbon($value, 'UTC'); |
76 | 76 | |
77 | 77 | //If the user is logged in then use there preferred timezone |
78 | - if (Auth::check()) |
|
79 | - $time = $time->setTimezone(Auth::user()->timezone); |
|
78 | + if (Auth::check()) { |
|
79 | + $time = $time->setTimezone(Auth::user()->timezone); |
|
80 | + } |
|
80 | 81 | |
81 | 82 | return $time->format('H:i'); |
82 | 83 | } |
@@ -94,8 +95,9 @@ discard block |
||
94 | 95 | $time = new Carbon($value, 'UTC'); |
95 | 96 | |
96 | 97 | //If the user is logged in then use there preferred timezone |
97 | - if (Auth::check()) |
|
98 | - $time = $time->setTimezone(Auth::user()->timezone); |
|
98 | + if (Auth::check()) { |
|
99 | + $time = $time->setTimezone(Auth::user()->timezone); |
|
100 | + } |
|
99 | 101 | |
100 | 102 | return $time->format('H:i'); |
101 | 103 | } |
@@ -115,9 +117,9 @@ discard block |
||
115 | 117 | { |
116 | 118 | $time = new Carbon($value, Auth::user()->timezone); |
117 | 119 | $time = $time->setTimezone('UTC'); |
120 | + } else { |
|
121 | + $time = new Carbon($value, 'UTC'); |
|
118 | 122 | } |
119 | - else |
|
120 | - $time = new Carbon($value, 'UTC'); |
|
121 | 123 | |
122 | 124 | $this->attributes['open_time'] = $time; |
123 | 125 | } |
@@ -137,9 +139,9 @@ discard block |
||
137 | 139 | { |
138 | 140 | $time = new Carbon($value, Auth::user()->timezone); |
139 | 141 | $time = $time->setTimezone('UTC'); |
142 | + } else { |
|
143 | + $time = new Carbon($value, 'UTC'); |
|
140 | 144 | } |
141 | - else |
|
142 | - $time = new Carbon($value, 'UTC'); |
|
143 | 145 | |
144 | 146 | $this->attributes['close_time'] = $time; |
145 | 147 | } |