Completed
Push — master ( 8ef67c...e71efc )
by claudio
06:23 queued 21s
created
app/Http/Controllers/Employees/Planners/MeetingsController.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
 {
15 15
     public function __construct()
16 16
     {
17
-        config(['auth.model' => \plunner\Planner::class]);
18
-        config(['jwt.user' => \plunner\Planner::class]);
17
+        config([ 'auth.model' => \plunner\Planner::class ]);
18
+        config([ 'jwt.user' => \plunner\Planner::class ]);
19 19
         $this->middleware('jwt.authandrefresh:mode-en');
20 20
     }
21 21
 
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
         $this->authorize($group);
34 34
         $meetings = $group->meetings();
35 35
         if ($request->query('current'))
36
-            $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)...
37
-                $query->where('start_time', '=', NULL);//to be planned
36
+            $meetings->where(function($query) { //parenthesis for conditions ...(C1 OR C2)...
37
+                $query->where('start_time', '=', NULL); //to be planned
38 38
                 //datetime to consider timezone, don't use mysql NOW()
39
-                $query->orWhere('start_time', '>=', new \DateTime());//planned
39
+                $query->orWhere('start_time', '>=', new \DateTime()); //planned
40 40
             });
41 41
 
42 42
         return $meetings->get();
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
         $meeting = Meeting::findOrFail($meetingId);
92 92
         $this->authorize($meeting);
93 93
         $input = $request->all();
94
-        if ($meeting->start_time != NULL && $meeting->duration != $input['duration'])
95
-            return Response::json(['error' => 'the meeting is already planned, you cannot change the duration'], 422);
94
+        if ($meeting->start_time != NULL && $meeting->duration != $input[ 'duration' ])
95
+            return Response::json([ 'error' => 'the meeting is already planned, you cannot change the duration' ], 422);
96 96
         $meeting->update($input);
97 97
         return $meeting;
98 98
     }
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,9 +32,11 @@  discard block
 block discarded – undo
32 32
         $group = Group::findOrFail($groupId);
33 33
         $this->authorize($group);
34 34
         $meetings = $group->meetings();
35
-        if ($request->query('current'))
36
-            $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)...
37
-                $query->where('start_time', '=', NULL);//to be planned
35
+        if ($request->query('current')) {
36
+                    $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)...
37
+                $query->where('start_time', '=', NULL);
38
+        }
39
+        //to be planned
38 40
                 //datetime to consider timezone, don't use mysql NOW()
39 41
                 $query->orWhere('start_time', '>=', new \DateTime());//planned
40 42
             });
@@ -91,8 +93,9 @@  discard block
 block discarded – undo
91 93
         $meeting = Meeting::findOrFail($meetingId);
92 94
         $this->authorize($meeting);
93 95
         $input = $request->all();
94
-        if ($meeting->start_time != NULL && $meeting->duration != $input['duration'])
95
-            return Response::json(['error' => 'the meeting is already planned, you cannot change the duration'], 422);
96
+        if ($meeting->start_time != NULL && $meeting->duration != $input['duration']) {
97
+                    return Response::json(['error' => 'the meeting is already planned, you cannot change the duration'], 422);
98
+        }
96 99
         $meeting->update($input);
97 100
         return $meeting;
98 101
     }
Please login to merge, or discard this patch.