Completed
Push — master ( 70c289...58ea5e )
by Brandon
21s
created
app/Device.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,8 +75,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.