Completed
Push — master ( a315a1...6807e8 )
by claudio
06:17
created
app/Http/Controllers/Employees/Planners/MeetingsController.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Http\Request;
6 6
 
7
-use plunner\Http\Requests;
8 7
 use plunner\Http\Controllers\Controller;
9 8
 
10 9
 class GroupsController extends Controller
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
 {
14 14
     public function __construct()
15 15
     {
16
-        config(['auth.model' => \plunner\Planner::class]);
17
-        config(['jwt.user' => \plunner\Planner::class]);
16
+        config([ 'auth.model' => \plunner\Planner::class ]);
17
+        config([ 'jwt.user' => \plunner\Planner::class ]);
18 18
         $this->middleware('jwt.authandrefresh:mode-en');
19 19
     }
20 20
 
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
         $this->authorize($group);
33 33
         $meetings = $group->meetings();
34 34
         if ($request->query('current'))
35
-            $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)...
36
-                $query->where('start_time', '=', NULL);//to be planned
35
+            $meetings->where(function($query) { //parenthesis for conditions ...(C1 OR C2)...
36
+                $query->where('start_time', '=', NULL); //to be planned
37 37
                 //datetime to consider timezone, don't use mysql NOW()
38
-                $query->orWhere('start_time', '>=', new \DateTime());//planned
38
+                $query->orWhere('start_time', '>=', new \DateTime()); //planned
39 39
             });
40 40
 
41 41
         return $meetings->get();
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,9 +31,11 @@
 block discarded – undo
31 31
         $group = Group::findOrFail($groupId);
32 32
         $this->authorize($group);
33 33
         $meetings = $group->meetings();
34
-        if ($request->query('current'))
35
-            $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)...
36
-                $query->where('start_time', '=', NULL);//to be planned
34
+        if ($request->query('current')) {
35
+                    $meetings->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)...
36
+                $query->where('start_time', '=', NULL);
37
+        }
38
+        //to be planned
37 39
                 //datetime to consider timezone, don't use mysql NOW()
38 40
                 $query->orWhere('start_time', '>=', new \DateTime());//planned
39 41
             });
Please login to merge, or discard this patch.
app/Http/Controllers/Employees/Planners/GroupsController.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
 {
13 13
     public function __construct()
14 14
     {
15
-        config(['auth.model' => Planner::class]);
16
-        config(['jwt.user' => Planner::class]);
15
+        config([ 'auth.model' => Planner::class ]);
16
+        config([ 'jwt.user' => Planner::class ]);
17 17
         $this->middleware('jwt.authandrefresh:mode-en');
18 18
     }
19 19
 
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
         $planner = \Auth::user();
33 33
         $groups = $planner->groupsManaged();
34 34
         if ($request->query('current'))
35
-            $groups->with(['meetings' => function ($query) {
36
-                $query->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)...
37
-                    $query->where('start_time', '=', NULL);//to be planned
35
+            $groups->with([ 'meetings' => function($query) {
36
+                $query->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
         else
43 43
             $groups->with('meetings');
44
-        return $groups->get();//both planed and to be planned
44
+        return $groups->get(); //both planed and to be planned
45 45
     }
46 46
 
47 47
     /**
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,16 +31,19 @@
 block discarded – undo
31 31
          */
32 32
         $planner = \Auth::user();
33 33
         $groups = $planner->groupsManaged();
34
-        if ($request->query('current'))
35
-            $groups->with(['meetings' => function ($query) {
34
+        if ($request->query('current')) {
35
+                    $groups->with(['meetings' => function ($query) {
36 36
                 $query->where(function ($query) { //parenthesis for conditions ...(C1 OR C2)...
37
-                    $query->where('start_time', '=', NULL);//to be planned
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
                 });
41 43
             }]);
42
-        else
43
-            $groups->with('meetings');
44
+        else {
45
+                    $groups->with('meetings');
46
+        }
44 47
         return $groups->get();//both planed and to be planned
45 48
     }
46 49
 
Please login to merge, or discard this patch.