Completed
Push — master ( 113f7a...a92f31 )
by claudio
08:47
created
app/Http/Controllers/Employees/Planners/MeetingTimeslotsController.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 {
17 17
     public function __construct()
18 18
     {
19
-        config(['auth.model' => \plunner\Planner::class]);
20
-        config(['jwt.user' => \plunner\Planner::class]);
19
+        config([ 'auth.model' => \plunner\Planner::class ]);
20
+        config([ 'jwt.user' => \plunner\Planner::class ]);
21 21
         $this->middleware('jwt.authandrefresh:mode-en');
22 22
     }
23 23
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
         if ($meeting->group_id == $groupId)
37 37
             return $meeting->timeslots;
38
-        return Response::json(['error' => 'meeting->group_id <> groupId'], 403);
38
+        return Response::json([ 'error' => 'meeting->group_id <> groupId' ], 403);
39 39
     }
40 40
 
41 41
     /**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
         if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId)
59 59
             return $timeslot;
60
-        return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403);
60
+        return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403);
61 61
     }
62 62
 
63 63
     /**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $meeting = Meeting::findOrFail($meetingId);
74 74
         $this->authorize($meeting);
75 75
         if ($meeting->start_time != NULL)
76
-            return Response::json(['error' => 'the meeting is already planned'], 422);
76
+            return Response::json([ 'error' => 'the meeting is already planned' ], 422);
77 77
 
78 78
         $input = $request->all();
79 79
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             $timeslot = $meeting->timeslots()->create($input);
82 82
             return $timeslot;
83 83
         }
84
-        return Response::json(['error' => 'meeting->group_id <> groupId'], 403);
84
+        return Response::json([ 'error' => 'meeting->group_id <> groupId' ], 403);
85 85
     }
86 86
 
87 87
     /**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $meeting = Meeting::findOrFail($meetingId);
98 98
         $this->authorize($meeting);
99 99
         if ($meeting->start_time != NULL)
100
-            return Response::json(['error' => 'the meeting is already planned'], 422);
100
+            return Response::json([ 'error' => 'the meeting is already planned' ], 422);
101 101
         $timeslot = MeetingTimeslot::findOrFail($timeslotId);
102 102
         $this->authorize($timeslot);
103 103
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             $timeslot->update($input);
108 108
             return $timeslot;
109 109
         }
110
-        return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403);
110
+        return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403);
111 111
     }
112 112
 
113 113
     /**
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $meeting = Meeting::findOrFail($meetingId);
126 126
         $this->authorize($meeting);
127 127
         if ($meeting->start_time != NULL)
128
-            return Response::json(['error' => 'the meeting is already planned'], 422);
128
+            return Response::json([ 'error' => 'the meeting is already planned' ], 422);
129 129
         $timeslot = MeetingTimeslot::findOrFail($timeslotId);
130 130
         $this->authorize($timeslot);
131 131
 
@@ -133,6 +133,6 @@  discard block
 block discarded – undo
133 133
             $timeslot->delete();
134 134
             return $timeslot;
135 135
         }
136
-        return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403);
136
+        return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403);
137 137
     }
138 138
 }
Please login to merge, or discard this patch.
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@  discard block
 block discarded – undo
33 33
         $meeting = Meeting::findOrFail($meetingId);
34 34
         $this->authorize($meeting);
35 35
 
36
-        if ($meeting->group_id == $groupId)
37
-            return $meeting->timeslots;
36
+        if ($meeting->group_id == $groupId) {
37
+                    return $meeting->timeslots;
38
+        }
38 39
         return Response::json(['error' => 'meeting->group_id <> groupId'], 403);
39 40
     }
40 41
 
@@ -55,8 +56,9 @@  discard block
 block discarded – undo
55 56
         $timeslot = MeetingTimeslot::findOrFail($timeslotId);
56 57
         $this->authorize($timeslot);
57 58
 
58
-        if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId)
59
-            return $timeslot;
59
+        if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId) {
60
+                    return $timeslot;
61
+        }
60 62
         return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403);
61 63
     }
62 64
 
@@ -72,8 +74,9 @@  discard block
 block discarded – undo
72 74
         $this->authorize($group);
73 75
         $meeting = Meeting::findOrFail($meetingId);
74 76
         $this->authorize($meeting);
75
-        if ($meeting->start_time != NULL)
76
-            return Response::json(['error' => 'the meeting is already planned'], 422);
77
+        if ($meeting->start_time != NULL) {
78
+                    return Response::json(['error' => 'the meeting is already planned'], 422);
79
+        }
77 80
 
78 81
         $input = $request->all();
79 82
 
@@ -96,8 +99,9 @@  discard block
 block discarded – undo
96 99
         $this->authorize($group);
97 100
         $meeting = Meeting::findOrFail($meetingId);
98 101
         $this->authorize($meeting);
99
-        if ($meeting->start_time != NULL)
100
-            return Response::json(['error' => 'the meeting is already planned'], 422);
102
+        if ($meeting->start_time != NULL) {
103
+                    return Response::json(['error' => 'the meeting is already planned'], 422);
104
+        }
101 105
         $timeslot = MeetingTimeslot::findOrFail($timeslotId);
102 106
         $this->authorize($timeslot);
103 107
 
@@ -124,8 +128,9 @@  discard block
 block discarded – undo
124 128
         $this->authorize($group);
125 129
         $meeting = Meeting::findOrFail($meetingId);
126 130
         $this->authorize($meeting);
127
-        if ($meeting->start_time != NULL)
128
-            return Response::json(['error' => 'the meeting is already planned'], 422);
131
+        if ($meeting->start_time != NULL) {
132
+                    return Response::json(['error' => 'the meeting is already planned'], 422);
133
+        }
129 134
         $timeslot = MeetingTimeslot::findOrFail($timeslotId);
130 135
         $this->authorize($timeslot);
131 136
 
Please login to merge, or discard this patch.