Completed
Push — master ( 04c35d...2014da )
by claudio
08:33
created
app/Http/Controllers/Employees/Planners/MeetingsController.php 1 patch
Spacing   +10 added lines, -10 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();
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function storeImage(\Illuminate\Http\Request $request, $groupId, $meetingId)
88 88
     {
89
-        $this->validate($request, ['file' => 'required|image']);
89
+        $this->validate($request, [ 'file' => 'required|image' ]);
90 90
         $group = Group::findOrFail($groupId);
91 91
         $this->authorize($group);
92 92
         $meeting = Meeting::findOrFail($meetingId);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
     private static function putImg($file, Meeting $meeting)
100 100
     {
101
-        \Storage::put('meetings/' . $meeting->id, \File::get($file));
101
+        \Storage::put('meetings/'.$meeting->id, \File::get($file));
102 102
     }
103 103
 
104 104
     /**
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
     private static function getImg(Meeting $meeting)
127 127
     {
128
-        $name = 'meetings/' . $meeting->id;
128
+        $name = 'meetings/'.$meeting->id;
129 129
         if (!\Storage::exists($name))
130 130
             return false;
131 131
         return \Storage::get($name);
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
         $this->authorize($meeting);
148 148
         $input = $request->all();
149 149
         //the planner cannot modify the duration of a planed meeting
150
-        if ($meeting->start_time != NULL && $meeting->duration != $input['duration'])
151
-            return Response::json(['error' => 'the meeting is already planned, you cannot change the duration'], 422);
150
+        if ($meeting->start_time != NULL && $meeting->duration != $input[ 'duration' ])
151
+            return Response::json([ 'error' => 'the meeting is already planned, you cannot change the duration' ], 422);
152 152
         $meeting->update($input);
153 153
         return $meeting;
154 154
     }
Please login to merge, or discard this patch.